Customizing Features for Your Practice > Using PracticeScript
PracticeScript uses the following order of precedence:
Explicit grouping with parentheses
Multiplication (*) and division (/)
Addition (+) and subtraction (-)
Bitmask operation (&)
Comparison operators (<, <=, =, >=, >)
Logical AND (AND)
Logical OR (OR)
Using the rules of precedence, the following complex expression:
3 + 4 * 5 = 35 OR 3 + 4 * 5 <= 23 AND 4 < 10
should be interpreted as:
3 + 20 = 35 OR 3 + 20 <= 23 AND 4 < 10
Multiplication has the highest precedence, followed by addition.
The comparison operators, FALSE OR TRUE AND TRUE, are next.
Logical AND is next, followed by logical OR.
In the list of operator precedence, an explicit grouping using parentheses has the highest precedence. Even when they are not necessary, parentheses can make an expression clearer.
For example, the expression 3 + (4 * 5) is easier to read with the parentheses, even though they are not necessary.
Be sure to use parentheses with the logical operators AND and OR, because they are not on the same level.