Adds two non-negative integers, returning a + b as a NonNegativeInt32.
Divides two non-negative integers using floor division (⌊a / b⌋): the
result is a / b rounded toward negative infinity, as a
NonNegativeInt32.
Converts an arbitrary number into a NonNegativeInt32, rounding to the
nearest integer and saturating the result into the range [MIN_VALUE, MAX_VALUE].
Unlike asNonNegativeInt32, this is total: out-of-range inputs are clamped
to the nearest representable NonNegativeInt32 instead of throwing.
Type guard that checks if a value is a non-negative integer in [0, 2^31).
isNonNegativeInt32 for usage examples
Readonlymax: (...values: readonly WithSmallInt<NonNegativeInt32>[]) => NonNegativeInt32Returns the largest of the given non-negative integers.
The largest value representable as NonNegativeInt32 (the upper saturation
target of fromNumber).
Readonlymin: (...values: readonly WithSmallInt<NonNegativeInt32>[]) => NonNegativeInt32Returns the smallest of the given non-negative integers.
The smallest value representable as NonNegativeInt32 (the lower
saturation target of fromNumber).
Multiplies two non-negative integers, returning a * b as a
NonNegativeInt32.
Raises a to the power b, returning a ** b as a NonNegativeInt32
(floored to an integer).
Generates a random NonNegativeInt32 within the given range.
The range is inclusive on both ends.
Subtracts two non-negative integers, returning a - b as a
NonNegativeInt32.
Namespace providing type-safe operations for the
NonNegativeInt32branded type.The
NonNegativeInt32type represents a non-negative integer in [0, 2^31). Division (div) uses floor division.