User Tools

Site Tools


en:arithmeticoperators

This is an old revision of the document!


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
*Multiplicationa * b
/Divisiona / bReturns a decimal 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.
++Increment Prefix++aIncrement (add one) the the variable and return the value after the increment. (may be applied ONLY to numeric variables or array elements) 1
++Increment Suffixa++Return the value of the variable and then increment the variable by one for the next time it is accessed. (may be applied ONLY to numeric variables or array elements) 1
Decrement Prefix–aDecrement (subtract one) the the variable and return the value after the decrement. (may be applied ONLY to numeric variables or array elements) 1
Decrrement Suffixa–Return the value of the variable and then decrement the variable by one for the next time it is accessed. (may be applied ONLY to numeric variables or array elements) 1


en/arithmeticoperators.1470787419.txt.gz · Last modified: 2020/02/28 10:46 (external edit)