Adds two non-positive safe integers, returning a + b as a
NonPositiveSafeInt.
Converts an arbitrary number into a NonPositiveSafeInt, rounding to the
nearest integer and saturating the result into the range [MIN_VALUE, MAX_VALUE].
Unlike asNonPositiveSafeInt, this is total: out-of-range inputs are
clamped to the nearest representable NonPositiveSafeInt instead of
throwing.
Type guard that checks if a value is a non-positive safe integer.
isNonPositiveSafeInt for usage examples
Readonlymax: (...values: readonly WithSmallInt<NonPositiveSafeInt>[]) => NonPositiveSafeIntReturns the largest of the given non-positive safe integers.
The largest value representable as NonPositiveSafeInt (the upper
saturation target of fromNumber).
Readonlymin: (...values: readonly WithSmallInt<NonPositiveSafeInt>[]) => NonPositiveSafeIntReturns the smallest of the given non-positive safe integers.
The smallest value representable as NonPositiveSafeInt (the lower
saturation target of fromNumber).
Raises a to the power b, returning a ** b as a NonPositiveSafeInt
(floored to an integer).
Generates a random NonPositiveSafeInt within the given range.
The range is inclusive on both ends.
Subtracts two non-positive safe integers, returning a - b as a
NonPositiveSafeInt.
Namespace providing type-safe operations for the
NonPositiveSafeIntbranded type.The
NonPositiveSafeInttype represents a non-positive safe integer. Division (div) uses floor division.