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

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

    All operations automatically clamp results to the valid NonZeroInt16 range [-32768, 32767] excluding 0. This ensures that all arithmetic maintains the 16-bit non-zero signed integer constraint, preventing zero results and overflow.

    Type Declaration

    • abs: (x: WithSmallInt) => ToNonNegative<NonZeroInt16>

      Returns the absolute value of a 16-bit non-zero signed integer.

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

      Adds two NonZeroInt16 values.

    • clamp: (x: number) => NonZeroInt16

      Clamps a number to the NonZeroInt16 range (avoiding zero).

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

      Divides one NonZeroInt16 by another using floor division.

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

      Type guard to check if a value is a NonZeroInt16.

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

      Returns the larger of two NonZeroInt16 values.

    • ReadonlyMAX_VALUE: number

      The maximum value for a 16-bit non-zero signed integer.

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

      Returns the smaller of two NonZeroInt16 values.

    • ReadonlyMIN_VALUE: number

      The minimum value for a 16-bit non-zero signed integer.

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

      Multiplies two NonZeroInt16 values.

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

      Raises a NonZeroInt16 to the power of another NonZeroInt16.

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

      Generates a random NonZeroInt16 value within the valid range.

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

      Subtracts one NonZeroInt16 from another.