Order of evaluation

  • When arithmetic operators and functions are used in a logical expression, the order of operations is functions and arithmetic operations first, then relational operators, and then logical operators.
  • When more than one logical operator is used, NOT is evaluated first, then AND, and then OR.
  • To change the order of evaluation, use parentheses.