@metreeca/core - v0.9.22
    Preparing search index...

    Function sub

    • Internal

      Subtracts a numeric value from another.

      Both operands must share the same numeric type: a number mixed with a bigint is reported rather than silently coerced. The shared type parameter rules out mixed operands at compile time, so a mixed pair is only reachable where the type parameter widens to the whole numeric union.

      Type Parameters

      • V extends number | bigint

        The numeric type shared by the operands and by the difference

      Parameters

      • x: V

        The minuend

      • y: V

        The subtrahend

      Returns V

      The difference between x and y, as a value of their shared numeric type

      If one operand is a number and the other a bigint