Arithmetic Operators

Arithmetic operators are simply the operations of simple math with integer and floating point numbers.

Arithmetic Operators
OperatorNameExampleComments
+Additiona + bAdd two numeric values. If both are an integer, then the result will be an integer. If one or both are floating point numbers then the result will be floating point. If one or both values are strings the plus operator will concatenate the strings.2
-Subtractiona - bSubtract two numeric values. If both were integer and the operation did not overflow then an integer will be returned else a floating point number will be the result.
*Multiplicationa * bMultiply the two numbers. If both were integer and the operation did not overflow then an integer will be returned else a floating point number will be the result.
/Divisiona / bReturns a floating point number of times that b goes into a.
\Integer Divisiona \ bReturns the number of whole times that b goes into a.
%Moduloa % bReturns the remainder of the integer division of a and b.
moda mod b

History

2.0.0.0Added 'mod' alias for modulo.