Returns the absolute value of a non-zero integer.
The result is non-negative and keeps the NonZeroInt brand. Note that
Math.abs(Number.MIN_SAFE_INTEGER) exceeds Number.MAX_SAFE_INTEGER, so
use SafeInt for guaranteed precision.
Type guard that checks if a value is a non-zero integer.
isNonZeroInt for usage examples
Readonlymax: (...values: readonly WithSmallInt<NonZeroInt>[]) => NonZeroIntReturns the largest of the given non-zero integers.
Readonlymin: (...values: readonly WithSmallInt<NonZeroInt>[]) => NonZeroIntReturns the smallest of the given non-zero integers.
Multiplies two non-zero integers, returning a * b as a NonZeroInt.
Raises a to the power b, returning a ** b as a NonZeroInt (floored
to an integer).
Generates a random NonZeroInt within the given range.
The range is inclusive on both ends.
Namespace providing type-safe operations for the
NonZeroIntbranded type.The
NonZeroInttype represents a non-zero integer. Division (div) uses floor division.Unlike
SafeInt,NonZeroIntallows values outside the safe integer range (±2^53 − 1), so very large magnitudes may lose precision in JavaScript'snumbertype.