Uint: {
add: (x: WithSmallInt, y: WithSmallInt) => NonNegativeInt;
clamp: (x: number) => NonNegativeInt;
div: (
x: WithSmallInt,
y: ToNonZeroIntWithSmallInt<NonNegativeInt>,
) => NonNegativeInt;
is: (a: number) => a is NonNegativeInt;
max: (
...values: readonly WithSmallInt<NonNegativeInt, 40>[],
) => NonNegativeInt;
min: (
...values: readonly WithSmallInt<NonNegativeInt, 40>[],
) => NonNegativeInt;
MIN_VALUE: 0;
mul: (x: WithSmallInt, y: WithSmallInt) => NonNegativeInt;
pow: (x: WithSmallInt, y: WithSmallInt) => NonNegativeInt;
random: (
min?: WithSmallInt<NonNegativeInt, 40>,
max?: WithSmallInt<NonNegativeInt, 40>,
) => NonNegativeInt;
sub: (x: WithSmallInt, y: WithSmallInt) => NonNegativeInt;
} = ...
Type Declaration
add: (x: WithSmallInt, y: WithSmallInt) => NonNegativeInt
clamp: (x: number) => NonNegativeInt
div: (x: WithSmallInt, y: ToNonZeroIntWithSmallInt<NonNegativeInt>) => NonNegativeInt
is: (a: number) => a is NonNegativeInt
Readonly
max: (...values: readonly WithSmallInt<NonNegativeInt, 40>[]) => NonNegativeInt
Readonly
min: (...values: readonly WithSmallInt<NonNegativeInt, 40>[]) => NonNegativeInt
Readonly
MIN_VALUE: 0
mul: (x: WithSmallInt, y: WithSmallInt) => NonNegativeInt
pow: (x: WithSmallInt, y: WithSmallInt) => NonNegativeInt
random: (
min?: WithSmallInt<NonNegativeInt, 40>,
max?: WithSmallInt<NonNegativeInt, 40>,
) => NonNegativeInt
sub: (x: WithSmallInt, y: WithSmallInt) => NonNegativeInt
Namespace providing type-safe arithmetic operations for unsigned integers.
All operations maintain the non-negative constraint by clamping negative results to 0. This ensures that all arithmetic preserves the unsigned integer property.