ts-type-forge
    Preparing search index...

    Type Alias NonZeroInt

    Branded numeric type for non-zero integers. Represents integers that are not equal to zero.

    const isNonZeroInt = (x: number): x is NonZeroInt =>
    Number.isInteger(x) && x !== 0;

    const modulo = (a: Int, b: NonZeroInt) => a % b;
    const gcd = (a: NonZeroInt, b: NonZeroInt): NonZeroInt => {
    // Euclidean algorithm implementation
    return (b === 0 ? a : gcd(b, (a % b) as NonZeroInt)) as NonZeroInt;
    };