Operator precedence

Operators are evaluated in the following order of precedence:

  • Unary identity and negation (+, –).
  • Exponentiation (^), Multiplication and floating-point division (*, /), Integer division (\, Div), Modulus arithmetic (Mod).
  • Addition and subtraction (+, –).
  • Comparison operators (=, <>, <, <=, >, >=).
  • Logical Conjunction (And), Inclusive disjunction (Or), Exclusive disjunction (Xor), bit-wise operators 

When operators of equal precedence occur together in an expression, for example multiplication and division, each operation is evaluated as it occurs from left to right. Parentheses can be used to override the order of precedence and to force some parts of an expression to be evaluated before others. Operations within parentheses are always performed before those outside. Within parentheses, however, operator precedence is maintained. 

The = operator, if part of an expression is only the equality comparison operator, not the assignment operator. 
The general syntax of an assignment statement is variable=expression. 
Unary operator “not” is not implement, while the function Not(expression) is provided, so the following statement is not allowed
   
a = Not b : ' Syntax error<

The following one is allowed

a = Not(b) : ' OK, this works

 

Comments