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

    Function add

    • Internal

      Adds two numeric values.

      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 sum

      Parameters

      • x: V

        The first addend

      • y: V

        The second addend

      Returns V

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

      If one operand is a number and the other a bigint