Operator Precedence

When an expression made up of more than one operator is evaluated, the higher precedence operators are evaluated first, proceeding from left to right, with the exception of exponentiation (**) which proceeds from right to left when used in a sequence.

For example

  1 + 2 * 3 ** 4 ** 5 / 6 - 7 ** 2

brackets as follows

  (1 + ((2 * (3 ** (4 ** 5))) / 6)) - (7 ** 2)

Note that

  4 ** 5 

is the first sub-expression to be evalutated and

  7 ** 2 

the second last.

See expression for a listing of operators in their order of precedence.


Herman Venter

This is Slim documentation as snarfed on 27 May 1999 by dB.