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>[]) => NonZeroInt;
min: (...values: readonly WithSmallInt<NonZeroInt>[]) => NonZeroInt;
mul: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt;
pow: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt;
random: (
min?: WithSmallInt<NonZeroInt>,
max?: WithSmallInt<NonZeroInt>,
) => 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
Readonlymax: (...values: readonly WithSmallInt<NonZeroInt>[]) => NonZeroInt
Readonlymin: (...values: readonly WithSmallInt<NonZeroInt>[]) => NonZeroInt
mul: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt
pow: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt
random: (min?: WithSmallInt<NonZeroInt>, max?: WithSmallInt<NonZeroInt>) => 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.