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