Operator priority
- Last UpdatedOct 04, 2024
- 1 minute read
- PI System
- PI Server 2023
- PI Server
The PE Scheduler executes operators in order of priority, from highest to lowest. When multiple operators have the same priority, the order of execution is either from left-to-right or right-to-left, depending on the operator, as listed in the following table.
|
Operator |
Priority (highest number is done first) |
Order |
|---|---|---|
|
Post |
8 |
L-R |
|
^ |
8 |
R-L |
|
Not UMINUS |
7 |
R-L |
|
) |
6 |
L-R |
|
( |
6 |
R-L |
|
* / mod |
5 |
L-R |
|
in .. in() |
5 |
R-L |
|
+ - |
4 |
L-R |
|
> >= = <> <= < Else |
3 |
L-R |
|
And |
2 |
L-R |
|
Or |
1 |
L-R |
You can use parentheses to specify the order of calculation. Regardless of operator priority, operations within parentheses are evaluated before operations outside those parentheses. For example:
(2 + 3) * 5 equals 25
while
2 + 3 * 5 equals 17