Operator Precedence

RPL operator precedence is similar to that of other programming languages, except RPL defines additional operators which are unique to RPL.

The following table shows the precedence assigned to operators. The operators in this table are listed in precedence order: the higher in the table an operator appears, the higher its precedence. Operators with higher precedence are evaluated before operators with lower precedence. Operators on the same line have equal precedence. When binary operators (operators with two “parameters”, as + and -) of equal precedence appear next to each other, they are evaluated in left-to-right order.

Note: RPL precedence rules are the same as those in C, Java, or JavaScript, with support for additional RPL operators that do not exist in those languages.

Operator group Operators

Highest precedence operators

[subvarName] [subStringRange] . ? (methodParams) expr! expr??

Unary prefix operators

+expr -expr !expr

Multiplicative

* / %

Additive

+ -

Relational

< > <= >= (and quivalents: gt, lt, etc.)

Equality

== != (and equivalents: =)

logical AND

&&

logical OR

||

numerical range

..

Next steps

Interpolations

Learn more

Arithmetical calculations