ts-data-forge
    Preparing search index...
    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;
    } = ...

    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.

    Type Declaration

    • abs: (x: WithSmallInt) => ToNonNegative<NonZeroInt>

      Returns the absolute value of a non-zero integer.

    • add: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt

      Adds two non-zero integers.

    • div: (x: WithSmallInt, y: ToNonZeroIntWithSmallInt<NonZeroInt>) => NonZeroInt

      Divides one non-zero integer by another using floor division.

    • is: (a: number) => a is NonZeroInt

      Type guard to check if a value is a NonZeroInt.

    • Readonlymax: (...values: readonly WithSmallInt<NonZeroInt, 40>[]) => NonZeroInt

      Returns the larger of two non-zero integers.

    • Readonlymin: (...values: readonly WithSmallInt<NonZeroInt, 40>[]) => NonZeroInt

      Returns the smaller of two non-zero integers.

    • mul: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt

      Multiplies two non-zero integers.

    • pow: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt

      Raises a non-zero integer to the power of another non-zero integer.

    • random: (
          min?: WithSmallInt<NonZeroInt, 40>,
          max?: WithSmallInt<NonZeroInt, 40>,
      ) => NonZeroInt

      Generates a random non-zero integer.

    • sub: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt

      Subtracts one non-zero integer from another.