Arithmetic Operators

Please note that operators are listed in the table below in highest to lowest precedence order.

As an example of how Operator Precedence works:

The formula:         2 + 3 * 4 – 5
Is evaluated as:    2  + (3 * 4) – 5
Results in:           2 + 12 – 5   =  14 – 5  =  9

Since Multiplication is of higher precedence than Addition and Subtraction, the expression
3 * 4 is first computed before the addition/subtraction operations in the expression are applied, yielding the correct result 9.

If you overlooked the precedence of the arithmetic operations, you might assume incorrectly that:  2 + 3 * 4 – 5 = ((2 + 3) * 4) - 5 = (5 * 4) – 5 = 20 – 5 = 15.

 

 

 

 

Arithmetic Operator

Arithmetic Operator Description

Unary Minus

-n

Unary minus, negates the numerical value of the expression it qualifies, [e.g., -5; -(2+3) ].

Power

^

Raise to a Power, uses the carat (^) symbol to represent an operator for an exponential power.
(e.g., 5 ^ 2 = 25, represents 52; and
       25 ^ 0.5 = 5, represents the square root of 25).

*, /, %

Multiplication (*), division (/), and a new division operator modulo (%) which simply divides and then multiplies the result by 100.

(e.g., 50 * 25 = 1250; 50 / 25 = 2;
         20 % 50 = .4 * 100 = 40)

Addition, Subtraction

+, -

Addition (+) and Subtraction (-) operators
(e.g., 2 + 3 – 4 = 1).