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

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

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

    Type Declaration

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

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

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

      Adds two Int32 values.

    • clamp: (x: number) => Int32

      Clamps a number to the Int32 range.

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

      Divides one Int32 by another using floor division.

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

      Type guard to check if a value is an Int32.

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

      Returns the larger of two Int32 values.

    • ReadonlyMAX_VALUE: number

      The maximum value for a 32-bit signed integer.

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

      Returns the smaller of two Int32 values.

    • ReadonlyMIN_VALUE: number

      The minimum value for a 32-bit signed integer.

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

      Multiplies two Int32 values.

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

      Raises an Int32 to the power of another Int32.

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

      Generates a random Int32 value within the valid range.

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

      Subtracts one Int32 from another.