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

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

    All operations automatically clamp results to the valid Uint16 range [0, 65535]. This ensures that all arithmetic maintains the 16-bit unsigned integer constraint, with negative results clamped to 0 and overflow results clamped to MAX_VALUE.

    Type Declaration

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

      Adds two Uint16 values.

    • clamp: (x: number) => Uint16

      Clamps a number to the Uint16 range.

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

      Divides one Uint16 by another using floor division.

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

      Type guard to check if a value is a Uint16.

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

      Returns the larger of two Uint16 values.

    • ReadonlyMAX_VALUE: number

      The maximum value for a 16-bit unsigned integer.

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

      Returns the smaller of two Uint16 values.

    • ReadonlyMIN_VALUE: 0

      The minimum value for a 16-bit unsigned integer.

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

      Multiplies two Uint16 values.

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

      Raises a Uint16 to the power of another Uint16.

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

      Generates a random Uint16 value within the valid range.

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

      Subtracts one Uint16 from another.