Skip to main content

xSuite Interface Windows Prism 5.x – Online Help

Order of Evaluation

If several operations are linked in a macro expression, then the Operators will be evaluated in a particular order (e.g., based on the general principle of multiplication and division before adding and subtracting).

In the program, the following priorities are set for the evaluation:

Notice

Operations of the same level are processed from left to right.

  1. ! not

  2. * / \ % mod

  3. + -

  4. == = != <> < > <= >= ~

  5. & && and | || or

In order to override the implicit order of evaluation or to make it recognizable in the sense of better readability, the priorities can be defined explicitly. For this, round brackets can be placed around subexpressions. These subexpressions are then prioritized in the evaluation.

The expressions enclosed in parentheses can be nested at any depth. In order to avoid syntax errors, ensure that the parentheses are balanced.

Example: the correct mathematical result of the expression 1+2*3 is 7. To override this rule and evaluate the expression from left to right to obtain the result 9, write (1+2)*3. This is how to prioritize execution of the addition contained in the calculation.