Previous: 2.2.8.5. Typecasts To the Table of Contents Next: 2.2.9. Statements
2.2.8.5. Typecasts Table of Contents 2.2.9. Statements

- 2.2.8.6. -
Table of Contents
2. TMT Pascal Language Description
2.2. Pascal Language Structure
2.2.8. Expressions
2.2.8.6. Operator Precedence


2.2.8.6. Operator Precedence


For expressions with three or more operands (i.e. 2 - 244 / 4), rules of precedence apply. The order of precedence for operators is listed from highest to lowest:
Operator TypeOperator
Unary Operators@, Not
Multiplying Operators*, /, Div, Mod, And, Shl, Shr
Adding Operators+, -, Or, Xor
Relational Operators=, <>, <, >, <=, >=, In
Operations are performed from left to right while operations of higher precedence are performed first. For instance, the following expression:
  7 + 4 * 2
is not the same as:
  (7 + 4) * 2
Since multiplication has a higher precedence than addition, multiplication is performed first followed by addition. Use parenthesis to separate operations that you want to be performed first.


Previous: 2.2.8.5. Typecasts To the Table of Contents Next: 2.2.9. Statements
2.2.8.5. Typecasts Table of Contents 2.2.9. Statements

- 2.2.8.6. -