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

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

    All operations automatically clamp results to the valid PositiveInt32 range [1, 2147483647]. This ensures that all arithmetic maintains the 32-bit positive integer constraint, with results below 1 clamped to MIN_VALUE and overflow results clamped to MAX_VALUE.

    Type Declaration

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

      Adds two PositiveInt32 values.

    • clamp: (x: number) => PositiveInt32

      Clamps a number to the PositiveInt32 range.

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

      Divides one PositiveInt32 by another using floor division.

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

      Type guard to check if a value is a PositiveInt32.

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

      Returns the larger of two PositiveInt32 values.

    • ReadonlyMAX_VALUE: number

      The maximum value for a 32-bit positive integer.

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

      Returns the smaller of two PositiveInt32 values.

    • ReadonlyMIN_VALUE: 1

      The minimum value for a 32-bit positive integer.

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

      Multiplies two PositiveInt32 values.

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

      Raises a PositiveInt32 to the power of another PositiveInt32.

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

      Generates a random PositiveInt32 value within the valid range.

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

      Subtracts one PositiveInt32 from another.