Skip to content
Blog

Numeric operators

Numeric operators are used to perform operations on numeric data types.

OperatorDescriptionExampleResult
+addition2 + 3.55.5
-subtraction4.5 - 22.5
*multiplication3.2 * 26.4
/division9 / 51
%module(remainder)9 % 54
^power4 ^ 51024.0

Appropriate types are cast wherever possible. For example, in 9 / 5, the result is 1 because both operands are integers. In 9.0 / 5, the result is 1.8 because one of the operands is a float.