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