API Reference › Huge
namespace

Huge

Idle/incremental big numbers — magnitudes far past what a 32- or 64-bit integer can hold, for prestige currencies and exponential growth. A Huge is a normalized mantissa (a Q16.16 fixed in [1, 10)) times 10^exponent, so it can represent 10^100 or 10^1000 while staying one small value. It is a display-scale number (about four significant digits), not a lockstep-exact one — keep it out of the deterministic simulation and reach for BigInt / Decimal when exactness matters. Build one with Huge.from, combine with add / sub / mul / neg, compare with cmp / sign, read mantissa / exp, and render as 1.23e45 with str. Arguments are positional. Spliced in only when a program mentions Huge.*.

Huge.from(value) -> HugeTurn an int into a Huge.Huge.add(a, b) -> HugeSum of two big numbers.Huge.sub(a, b) -> HugeDifference of two big numbers.Huge.mul(a, b) -> HugeProduct of two big numbers.Huge.neg(a) -> HugeNegate a big number.Huge.cmp(a, b) -> intCompare two big numbers: -1, 0, or 1.Huge.sign(a) -> intThe sign: -1, 0, or 1.Huge.mantissa(a) -> fixedThe mantissa in [1, 10).Huge.exp(a) -> intThe base-10 exponent.Huge.str(a) -> stringRender as scientific text like 1.23e45.
← All symbols