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

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

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

      Adds two NonNegativeInt16 values.

    • clamp: (x: number) => NonNegativeInt16

      Clamps a number to the NonNegativeInt16 range.

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

      Divides one NonNegativeInt16 by another using floor division.

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

      Type guard to check if a value is a NonNegativeInt16.

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

      Returns the larger of two NonNegativeInt16 values.

    • ReadonlyMAX_VALUE: number

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

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

      Returns the smaller of two NonNegativeInt16 values.

    • ReadonlyMIN_VALUE: 0

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

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

      Multiplies two NonNegativeInt16 values.

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

      Raises a NonNegativeInt16 to the power of another NonNegativeInt16.

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

      Generates a random NonNegativeInt16 value within the valid range.

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

      Subtracts one NonNegativeInt16 from another.