Next: , Previous: Grouping Operators, Up: Expressions

7.4 Arithmetic Operators

The arithmetic operators take numeric operands and produce numeric results.

a + b
Yields the sum of a and b.

a - b
Subtracts b from a and yields the difference.

a * b
Yields the product of a and b. If either a or b is 0, then the result is 0, even if the other operand is missing.

a / b
Divides a by b and yields the quotient. If a is 0, then the result is 0, even if b is missing. If b is zero, the result is system-missing.

a ** b
Yields the result of raising a to the power b. If a is negative and b is not an integer, the result is system-missing. The result of 0**0 is system-missing as well.

- a
Reverses the sign of a.