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