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

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

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

      Adds two PositiveInt16 values.

    • clamp: (x: number) => PositiveInt16

      Clamps a number to the PositiveInt16 range.

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

      Divides one PositiveInt16 by another using floor division.

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

      Type guard to check if a value is a PositiveInt16.

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

      Returns the larger of two PositiveInt16 values.

    • ReadonlyMAX_VALUE: number

      The maximum value for a 16-bit positive integer.

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

      Returns the smaller of two PositiveInt16 values.

    • ReadonlyMIN_VALUE: 1

      The minimum value for a 16-bit positive integer.

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

      Multiplies two PositiveInt16 values.

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

      Raises a PositiveInt16 to the power of another PositiveInt16.

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

      Generates a random PositiveInt16 value within the valid range.

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

      Subtracts one PositiveInt16 from another.