BigInt
BigInt module: arbitrary-precision integers.
Representation: BigInt(sign, digits) where sign : Bool — true = non-negative, false = negative digits : List(Int) — little-endian base-10000 digit list (least significant limb first) BigInt(true, Nil) represents zero.
Base 10000 is convenient: each limb stores 4 decimal digits, so to_string is straightforward without requiring integer logarithms.
Interface implementations: impl Eq(BigInt) — eq/2, == impl Ord(BigInt) — compare/2, < impl Show(BigInt) — show/1
Types
Functions
Divides a by b (integer division, truncates toward zero). Panics if b is zero.
Computes a mod b (remainder, same sign as a). Panics if b is zero.
Compares two BigInts. Returns -1 (a < b), 0 (a == b), or 1 (a > b).