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

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

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

    Type Declaration

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

      Adds two PositiveUint32 values.

    • clamp: (x: number) => PositiveUint32

      Clamps a number to the PositiveUint32 range.

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

      Divides one PositiveUint32 by another using floor division.

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

      Type guard to check if a value is a PositiveUint32.

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

      Returns the larger of two PositiveUint32 values.

    • ReadonlyMAX_VALUE: number

      The maximum value for a 32-bit positive unsigned integer.

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

      Returns the smaller of two PositiveUint32 values.

    • ReadonlyMIN_VALUE: 1

      The minimum value for a 32-bit positive unsigned integer.

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

      Multiplies two PositiveUint32 values.

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

      Raises a PositiveUint32 to the power of another PositiveUint32.

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

      Generates a random PositiveUint32 value within the valid range.

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

      Subtracts one PositiveUint32 from another.