Types phase 5 (polish). A splice-on-demand numeric runtime (runtime/native/numeric.ludic, built on the inline Math.* trig) behind three namespaces: - Huge.* — idle big numbers (normalized mantissa x 10^exponent): from/add/ sub/mul/neg/cmp/sign/mantissa/exp/str (scientific 1.23e45). Display-scale, not lockstep-exact (BigInt/Decimal for exactness). - Angle.* — auto-wrapping radians: from_degrees/to_degrees/wrap/sin/cos/add/ diff (shortest signed rotation)/lerp (shortest arc). - Percent.* — clamped [0,1]: clamp/of/lerp/apply. Remaining phase-5 items are already covered (duration=Duration.*, rune=Unicode.*, i64=long) or need a type-checking pass (handle, typed name, other sized ints) — tracked for later. Wired: parser splice trigger (g_uses_numeric), emit_call dispatch, reseeded seed, a self-asserting example (examples/library/numeric.ludic + feat_case), per-symbol docs + inventory. All suites green incl. golden renders byte- identical and the bootstrap fixpoint. NOTE: fixed `const`s lower to raw-int-typed values (emit_call N_CONST), which breaks fixed comparisons — the runtime uses inline fixed literals instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
22 lines
459 B
Markdown
22 lines
459 B
Markdown
---
|
|
id: huge-str
|
|
name: Huge.str
|
|
category: huge
|
|
kind: namespace-method
|
|
tokens: Huge.str
|
|
sig: Huge.str(a) -> string
|
|
tip: Render as scientific text like 1.23e45.
|
|
order: 9
|
|
ns: Huge
|
|
member: str
|
|
---
|
|
|
|
Renders the value in scientific form, like <code>1.23e45</code> (a two-decimal mantissa). This is how you show an idle magnitude on the HUD.
|
|
|
|
```ludic
|
|
program Demo {
|
|
handler Step phase Update {
|
|
Screen.draw_text(8, 8, Huge.str(gold), Color.White, 1)
|
|
}
|
|
}
|
|
```
|