Returns the absolute value of a non-zero safe integer.
The result is non-negative and keeps the NonZeroSafeInt brand.
Converts an arbitrary number into a NonZeroSafeInt, rounding to the
nearest integer and saturating the result into the range [MIN_VALUE, MAX_VALUE].
Unlike asNonZeroSafeInt, this is total: out-of-range inputs are clamped
to the nearest representable NonZeroSafeInt instead of throwing.
Type guard that checks if a value is a non-zero safe integer.
isNonZeroSafeInt for usage examples
Readonlymax: (...values: readonly WithSmallInt<NonZeroSafeInt>[]) => NonZeroSafeIntReturns the largest of the given non-zero safe integers.
The largest value representable as NonZeroSafeInt (the upper saturation
target of fromNumber).
Readonlymin: (...values: readonly WithSmallInt<NonZeroSafeInt>[]) => NonZeroSafeIntReturns the smallest of the given non-zero safe integers.
The smallest value representable as NonZeroSafeInt (the lower saturation
target of fromNumber).
Multiplies two non-zero safe integers, returning a * b as a
NonZeroSafeInt.
Raises a to the power b, returning a ** b as a NonZeroSafeInt
(floored to an integer).
Generates a random NonZeroSafeInt within the given range.
The range is inclusive on both ends.
Namespace providing type-safe operations for the
NonZeroSafeIntbranded type.The
NonZeroSafeInttype represents a non-zero safe integer. Division (div) uses floor division.