Expand description
Arbitrary-precision signed integer (BigInt).
This is part of the §3.1 “exact computation” foundation. It is a real,
self-contained big-integer implementation — sign + little-endian u32
magnitude limbs with schoolbook multiply and long division. It is not a
wrapper around i128.
Heap-side is fine here: this is exact arbitrary-precision arithmetic, not a
zero-heap hot path. Operations that can fail (division by zero) return an
Option/Result and fail closed — they never fabricate a value.
Internal representation invariants:
magholds base-2^32 limbs, little-endian (least significant first).magis always normalised: no trailing zero limbs. Zero is the empty vector withsign == 0.signis-1,0, or+1.sign == 0iffmagis empty.
Structs§
- BigInt
- Arbitrary-precision signed integer.