ts-data-forge
    Preparing search index...

    Function sub

    • Subtracts b from a, returning the tightest sound branded result type.

      The sign is computed exactly; the level is preserved (with SafeInt widening to Int). No clamping — for saturating subtraction that stays in a bounded type (e.g. Uint.sub clamping at 0), use that type's branded sub.

      Type Parameters

      • A extends number
      • B extends number

      Parameters

      • a: A

        The minuend.

      • b: B

        The subtrahend.

      Returns SubResult<A, B>

      a - b, typed as the tightest branded type guaranteed to contain it.