Readonlyadd: (x: WithSmallInt<Uint32, 40>, y: WithSmallInt<Uint32, 40>) => Uint32Adds two non-negative integers, returning a + b as an Uint32.
Readonlydiv: (Divides two non-negative integers using floor division (⌊a / b⌋): the
result is a / b rounded toward negative infinity, as an Uint32.
ReadonlyfromNumber: (x: number) => Uint32Converts an arbitrary number into an Uint32, rounding to the nearest
integer and saturating the result into the range [MIN_VALUE, MAX_VALUE].
Unlike asUint32, this is total: out-of-range inputs are clamped to the
nearest representable Uint32 instead of throwing.
Readonlyis: (a: number) => a is Uint32Type guard that checks if a value is a non-negative integer less than 2^32.
isUint32 for usage examples
Readonlymax: (...values: readonly WithSmallInt<Uint32, 40>[]) => Uint32Returns the largest of the given non-negative integers.
ReadonlyMAX_VALUE: numberThe largest value representable as Uint32 (the upper saturation target of
fromNumber).
Readonlymin: (...values: readonly WithSmallInt<Uint32, 40>[]) => Uint32Returns the smallest of the given non-negative integers.
ReadonlyMIN_VALUE: 0The smallest value representable as Uint32 (the lower saturation target
of fromNumber).
Readonlymul: (x: WithSmallInt<Uint32, 40>, y: WithSmallInt<Uint32, 40>) => Uint32Multiplies two non-negative integers, returning a * b as an Uint32.
Readonlypow: (x: WithSmallInt<Uint32, 40>, y: WithSmallInt<Uint32, 40>) => Uint32Raises a to the power b, returning a ** b as an Uint32 (floored to
an integer).
Readonlyrandom: (min?: WithSmallInt<Uint32, 40>, max?: WithSmallInt<Uint32, 40>) => Uint32Generates a random Uint32 within the given range.
The range is inclusive on both ends.
Readonlysub: (x: WithSmallInt<Uint32, 40>, y: WithSmallInt<Uint32, 40>) => Uint32Subtracts two non-negative integers, returning a - b as an Uint32.
Namespace providing type-safe operations for the
Uint32branded type.The
Uint32type represents a non-negative integer less than 2^32. Division (div) uses floor division.