Arithmetic Methods >>-arithmetic_operator(argument)------------------------------->< Note The syntax diagram above is for the non-prefix operators. The prefix + and [argument] . Returns the result of performing the specified arithmetic operation on the receiver object. The receiver object and the [argument] must be valid numbers (see ). The [arithmetic_operator] can be: | |
+ + method method+ | Addition |
- - method method- | Subtraction |
* * method method* | Multiplication |
/ / method method/ | Division |
% % method method% | Integer division (divide and return the integer part of the result) |
// // method method// | Remainder (divide and return the remainder—not modulo, because the result can be negative) |
** ** method method** | Exponentiation (raise a number to a whole-number power) |
Prefix - methodprefix - | Same as the subtraction: 0 - number |
Prefix + methodprefix + | Same as the addition: 0 + number |