Order of Operations

Operators are evaluated according to a strict set of rules. These rules are called the “Order of Operations”.

Order of Operations
LevelOperatorsCategory/Description
1( )Grouping
2^Exponent
3- ~Unary Minus and Bitwise Negation (NOT)
4* / \Multiplication, Division, and Integer Division
5%Integer Remainder (Mod)
6+ - ;Addition/Concatenation, and Subtraction
7& |Bitwise And and Bitwise Or
8< ⇐ > >= = <>Comparison (Numeric and String)
9NOTNot
10ANDLogical And
11ORLogical Or
12XORLogical Exclusive Or