Readonlyadd: (Adds two positive integers, returning a + b as a PositiveUint16.
Readonlydiv: (Divides two positive integers using floor division (⌊a / b⌋): the result
is a / b rounded toward negative infinity, as a PositiveUint16.
ReadonlyfromNumber: (x: number) => PositiveUint16Converts an arbitrary number into a PositiveUint16, rounding to the
nearest integer and saturating the result into the range [MIN_VALUE, MAX_VALUE].
Unlike asPositiveUint16, this is total: out-of-range inputs are clamped
to the nearest representable PositiveUint16 instead of throwing.
Readonlyis: (a: number) => a is PositiveUint16Type guard that checks if a value is a positive integer in [1, 2^16).
isPositiveUint16 for usage examples
Readonlymax: (...values: readonly WithSmallInt<PositiveUint16, 40>[]) => PositiveUint16Returns the largest of the given positive integers.
ReadonlyMAX_VALUE: numberThe largest value representable as PositiveUint16 (the upper saturation
target of fromNumber).
Readonlymin: (...values: readonly WithSmallInt<PositiveUint16, 40>[]) => PositiveUint16Returns the smallest of the given positive integers.
ReadonlyMIN_VALUE: 1The smallest value representable as PositiveUint16 (the lower saturation
target of fromNumber).
Readonlymul: (Multiplies two positive integers, returning a * b as a PositiveUint16.
Readonlypow: (Raises a to the power b, returning a ** b as a PositiveUint16
(floored to an integer).
Readonlyrandom: (Generates a random PositiveUint16 within the given range.
The range is inclusive on both ends.
Readonlysub: (Subtracts two positive integers, returning a - b as a PositiveUint16.
Namespace providing type-safe operations for the
PositiveUint16branded type.The
PositiveUint16type represents a positive integer in [1, 2^16). Division (div) uses floor division.