Adds two non-negative integers, returning a + b as an Uint.
Divides two non-negative integers using floor division (⌊a / b⌋): the
result is a / b rounded toward negative infinity, as an Uint.
Converts an arbitrary number into an Uint, rounding to the nearest
integer and saturating the result into the range [MIN_VALUE, MAX_VALUE].
Unlike asUint, this is total: out-of-range inputs are clamped to the
nearest representable Uint instead of throwing.
Type guard that checks if a value is a non-negative integer.
isUint for usage examples
Readonlymax: (...values: readonly WithSmallInt<NonNegativeInt>[]) => NonNegativeIntReturns the largest of the given non-negative integers.
Readonlymin: (...values: readonly WithSmallInt<NonNegativeInt>[]) => NonNegativeIntReturns the smallest of the given non-negative integers.
The smallest value representable as Uint (the lower saturation target of
fromNumber).
Multiplies two non-negative integers, returning a * b as an Uint.
Raises a to the power b, returning a ** b as an Uint (floored to an
integer).
Generates a random Uint within the given range.
The range is inclusive on both ends.
Subtracts two non-negative integers, returning a - b as an Uint.
Namespace providing type-safe operations for the
Uintbranded type.The
Uinttype represents a non-negative integer. Division (div) uses floor division.Unlike
SafeInt,Uintallows values outside the safe integer range (±2^53 − 1), so very large magnitudes may lose precision in JavaScript'snumbertype.