Skip to main content
Close announcements banner

Operator expressions

The following sections describe the operators that you can use in expressions.

When using several operators in the same expression, you can use parentheses to define the order of the operations. For example, in 3 * (1 + 2), the 1 + 2 addition is performed first. If you do not use parentheses, the following order is used:
  1. *, / and %
  2. + and -
  3. =, ==, !=, <, <=, > and >=
  4. && and ||
For example:
  • 3 * 1 + 2 is equivalent to (3 * 1) + 2
  • 3 * 1 + 2 / 2 is equivalent to (3 * 1) + ( 2 / 2 )
  • 3 + 1 == 8 / 2 || 1 + 3 * 2 >= 9 - 5 is equivalent to ((3 + 1) == (8 / 2)) || (( 1 + (3 * 2)) >= (9 - 5))

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!