← Standard library

BigIntOps

static class BigIntOps
import BigIntOps from Wax;

Arithmetic support for the parser's fixed-capacity BigInt scratch values. Operands must fit the 62-limb capacity and have valid normalized active ranges. Operations can mutate shared limb arrays and return updated lengths; assign the result. This surface does not provide checked arbitrary-precision arithmetic.

FloatParse.wax:312

Inherits from object. Follow these links for inherited members.

Members

kLimbCountconst

const int32 kLimbCount = 62

The fixed limb capacity, 62.

FloatParse.wax:317

kLimbBitsconst

const uint32 kLimbBits = 64u

The bit width of one limb, 64.

FloatParse.wax:321

Normalizemethod

public static fn Normalize(BigInt bi) : BigInt

Returns a record whose active length excludes high zero limbs. Does not copy the shared storage.

FloatParse.wax:331

Emptymethod

public static fn Empty() : BigInt

Allocates an empty zero BigInt.

FloatParse.wax:398

Makemethod

public static fn Make(uint64 value) : BigInt

Creates a normalized BigInt from one unsigned scalar.

FloatParse.wax:407

Hi64method

public static fn Hi64(BigInt bi) : Hi64Result

Returns the high significant bits left-aligned in 64 bits and reports whether discarded lower bits were nonzero.

FloatParse.wax:424

Comparemethod

public static fn Compare(BigInt a, BigInt b) : int32

Compares normalized values, returning -1, 0, or 1.

FloatParse.wax:467

ShlBitsmethod

public static fn ShlBits(BigInt bi, uint32 n) : BigInt

Shifts left by n bits with 0 < n < 64, mutating the limbs. The result must fit capacity.

FloatParse.wax:484

ShlLimbsmethod

public static fn ShlLimbs(BigInt bi, uint32 n) : BigInt

Shifts left by n complete limbs, inserting low zero limbs. The result must fit capacity; zero n leaves the value unchanged.

FloatParse.wax:509

Shlmethod

public static fn Shl(BigInt bi, uint32 n) : BigInt

Shifts left by any bit count whose result fits capacity, combining whole-limb and partial-limb shifts.

FloatParse.wax:533

Ctlzmethod

public static fn Ctlz(BigInt bi) : int32

Counts leading zeros in the highest active limb. An empty integer returns zero.

FloatParse.wax:552

BitLengthmethod

public static fn BitLength(BigInt bi) : int32

Returns the number of significant bits in a normalized value; zero has length zero.

FloatParse.wax:562

SmallAddmethod

public static fn SmallAdd(BigInt bi, uint64 y) : BigInt

Adds an unsigned scalar to shared limb storage and returns the updated record. The result must fit capacity.

FloatParse.wax:593

SmallMulmethod

public static fn SmallMul(BigInt bi, uint64 y) : BigInt

Multiplies shared limb storage by an unsigned scalar and returns the updated record. The result must fit capacity; Normalize can remove high zero limbs.

FloatParse.wax:602

LongMulmethod

public static fn LongMul(BigInt x, BigInt y) : BigInt

Multiplies x by a nonzero normalized y using long multiplication. Mutates x storage; y must not alias it, and the result must fit capacity.

FloatParse.wax:664

LargeMulmethod

public static fn LargeMul(BigInt x, BigInt y) : BigInt

Multiplies x by a nonzero normalized y, selecting scalar or long multiplication. The arrays must not alias and the result must fit capacity.

FloatParse.wax:691

Mulmethod

public static fn Mul(BigInt bi, uint64 y) : BigInt

Multiplies by a scalar using SmallMul; preserve the returned record and capacity preconditions.

FloatParse.wax:704

Addmethod

public static fn Add(BigInt bi, uint64 y) : BigInt

Adds a scalar using SmallAdd; preserve the returned record and capacity preconditions.

FloatParse.wax:712

Pow2method

public static fn Pow2(BigInt bi, uint32 exp) : BigInt

Multiplies by 2^exp using a left shift. The result must fit capacity.

FloatParse.wax:722

Pow5method

public static fn Pow5(BigInt bi, uint32 exp) : BigInt

Multiplies by 5^exp using parser power tables. The result must fit capacity.

FloatParse.wax:730

Pow10method

public static fn Pow10(BigInt bi, uint32 exp) : BigInt

Multiplies by 10^exp using powers of five and two. The result must fit capacity.

FloatParse.wax:766