Product SiteDocumentation Site

1.11.2.2. Arithmetic

You can combine character strings that are valid numbers (see Section 1.10.4.5, “Numbers”) using the following arithmetic operators:
+
Add
-
Subtract
*
Multiply
/
Divide
%
Integer divide (divide and return the integer part of the result)
//
Remainder (divide and return the remainder—not modulo, because the result can be negative)
**
Power (raise a number to a whole-number power)
Prefix -
Same as the subtraction: 0 - number
Prefix +
Same as the addition: 0 + number
See Chapter 10, Numbers and Arithmetic for details about precision, the format of valid numbers, and the operation rules for arithmetic. Note that if an arithmetic result is shown in exponential notation, it is likely that rounding has occurred.