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

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

    All operations automatically clamp results to the valid NonNegativeInt32 range [0, 2147483647]. This ensures that all arithmetic maintains the 32-bit non-negative integer constraint, with negative results clamped to 0 and overflow results clamped to MAX_VALUE.

    Type Declaration

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

      Adds two NonNegativeInt32 values.

    • clamp: (x: number) => NonNegativeInt32

      Clamps a number to the NonNegativeInt32 range.

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

      Divides one NonNegativeInt32 by another using floor division.

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

      Type guard to check if a value is a NonNegativeInt32.

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

      Returns the larger of two NonNegativeInt32 values.

    • ReadonlyMAX_VALUE: number

      The maximum value for a 32-bit non-negative integer.

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

      Returns the smaller of two NonNegativeInt32 values.

    • ReadonlyMIN_VALUE: 0

      The minimum value for a 32-bit non-negative integer.

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

      Multiplies two NonNegativeInt32 values.

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

      Raises a NonNegativeInt32 to the power of another NonNegativeInt32.

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

      Generates a random NonNegativeInt32 value within the valid range.

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

      Subtracts one NonNegativeInt32 from another.