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

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

    All operations automatically clamp results to the valid PositiveUint16 range [1, 65535]. This ensures that all arithmetic maintains the 16-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) => PositiveUint16

      Adds two PositiveUint16 values.

    • clamp: (x: number) => PositiveUint16

      Clamps a number to the PositiveUint16 range.

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

      Divides one PositiveUint16 by another using floor division.

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

      Type guard to check if a value is a PositiveUint16.

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

      Returns the larger of two PositiveUint16 values.

    • ReadonlyMAX_VALUE: number

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

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

      Returns the smaller of two PositiveUint16 values.

    • ReadonlyMIN_VALUE: 1

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

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

      Multiplies two PositiveUint16 values.

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

      Raises a PositiveUint16 to the power of another PositiveUint16.

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

      Generates a random PositiveUint16 value within the valid range.

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

      Subtracts one PositiveUint16 from another.