There math operators works with numeric data types (integer and float) and also with string. All are binary (except unary minus).
Operator | Datatype | Description |
---|---|---|
+ | integer, float, string | The result is sum of the numbers or concatenation of the strings. |
- | integer, float | The result is difference of the numbers. |
* | integer, float | The result is product of the numbers. |
/ | integer, float | The result is quotient of the numbers (number class is preserved, thus quotient of integers produce integer, etc). |
% | integer | The result is modulo. |
unary - | integer, float | The result is negative number. |