Const
Adds two SafeUint values.
Clamps a number to the safe unsigned integer range.
Divides one SafeUint by another using floor division.
Type guard to check if a value is a SafeUint.
Readonly
max: (...values: readonly WithSmallInt<SafeUint, 40>[]) => SafeUintReturns the larger of two SafeUint values.
Readonly
MAX_VALUE: SafeUintThe maximum safe integer value (2^53 - 1).
Readonly
min: (...values: readonly WithSmallInt<SafeUint, 40>[]) => SafeUintReturns the smaller of two SafeUint values.
Readonly
MIN_VALUE: 0The minimum value for a safe unsigned integer.
Multiplies two SafeUint values.
Raises a SafeUint to the power of another SafeUint.
Generates a random SafeUint value within the valid range.
Subtracts one SafeUint from another.
Namespace providing type-safe arithmetic operations for safe unsigned integers.
All operations automatically clamp results to the safe unsigned integer range [0, MAX_SAFE_INTEGER]. This ensures that all arithmetic maintains both the non-negative constraint and IEEE 754 precision guarantees, preventing precision loss while ensuring results are never negative.