6.4. Math Operators

There math operators works with numeric data types (integer and float) and also with string. All are binary (except unary minus).

OperatorDatatypeDescription
+integer, float, stringThe result is sum of the numbers or concatenation of the strings.
-integer, floatThe result is difference of the numbers.
*integer, floatThe result is product of the numbers.
/integer, floatThe result is quotient of the numbers (number class is preserved, thus quotient of integers produce integer, etc).
%integerThe result is modulo.
unary -integer, floatThe result is negative number.