ts-data-forge
    Preparing search index...
    NonZeroInt32: {
        abs: (x: WithSmallInt) => ToNonNegative<NonZeroInt32>;
        add: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt32;
        clamp: (x: number) => NonZeroInt32;
        div: (
            x: WithSmallInt,
            y: ToNonZeroIntWithSmallInt<NonZeroInt32>,
        ) => NonZeroInt32;
        is: (a: number) => a is NonZeroInt32;
        max: (...values: readonly WithSmallInt<NonZeroInt32, 40>[]) => NonZeroInt32;
        MAX_VALUE: number;
        min: (...values: readonly WithSmallInt<NonZeroInt32, 40>[]) => NonZeroInt32;
        MIN_VALUE: number;
        mul: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt32;
        pow: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt32;
        random: (
            min?: WithSmallInt<NonZeroInt32, 40>,
            max?: WithSmallInt<NonZeroInt32, 40>,
        ) => NonZeroInt32;
        sub: (x: WithSmallInt, y: WithSmallInt) => NonZeroInt32;
    } = ...

    Namespace providing type-safe arithmetic operations for 32-bit non-zero signed integers.

    All operations automatically clamp results to the valid NonZeroInt32 range [-2147483648, 2147483647] excluding 0. This ensures that all arithmetic maintains the 32-bit non-zero signed integer constraint, preventing zero results and overflow.

    Type Declaration

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

      Returns the absolute value of a 32-bit non-zero signed integer.

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

      Adds two NonZeroInt32 values.

    • clamp: (x: number) => NonZeroInt32

      Clamps a number to the NonZeroInt32 range (avoiding zero).

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

      Divides one NonZeroInt32 by another using floor division.

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

      Type guard to check if a value is a NonZeroInt32.

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

      Returns the larger of two NonZeroInt32 values.

    • ReadonlyMAX_VALUE: number

      The maximum value for a 32-bit non-zero signed integer.

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

      Returns the smaller of two NonZeroInt32 values.

    • ReadonlyMIN_VALUE: number

      The minimum value for a 32-bit non-zero signed integer.

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

      Multiplies two NonZeroInt32 values.

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

      Raises a NonZeroInt32 to the power of another NonZeroInt32.

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

      Generates a random NonZeroInt32 value within the valid range.

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

      Subtracts one NonZeroInt32 from another.