NonZeroInt: {
abs: (x: WithSmallInt) => ToNonNegative<NonZeroInt>;
add: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt;
div: (
x: WithSmallInt,
y: ToNonZeroIntWithSmallInt<NonZeroInt>,
) => NonZeroInt;
is: (a: number) => a is NonZeroInt;
max: (...values: readonly WithSmallInt<NonZeroInt, 40>[]) => NonZeroInt;
min: (...values: readonly WithSmallInt<NonZeroInt, 40>[]) => NonZeroInt;
mul: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt;
pow: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt;
random: (
min?: WithSmallInt<NonZeroInt, 40>,
max?: WithSmallInt<NonZeroInt, 40>,
) => NonZeroInt;
sub: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt;
} = ...
Type Declaration
abs: (x: WithSmallInt) => ToNonNegative<NonZeroInt>
add: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt
div: (x: WithSmallInt, y: ToNonZeroIntWithSmallInt<NonZeroInt>) => NonZeroInt
is: (a: number) => a is NonZeroInt
Readonly
max: (...values: readonly WithSmallInt<NonZeroInt, 40>[]) => NonZeroInt
Readonly
min: (...values: readonly WithSmallInt<NonZeroInt, 40>[]) => NonZeroInt
mul: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt
pow: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt
random: (
min?: WithSmallInt<NonZeroInt, 40>,
max?: WithSmallInt<NonZeroInt, 40>,
) => NonZeroInt
sub: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt
Namespace providing type-safe arithmetic operations for non-zero integers.
All operations maintain the non-zero constraint, ensuring that results are always valid NonZeroInt values. Division operations return floor division results, and all arithmetic maintains integer precision.