About Calculator Operators

The calculator operators can perform differently, depending on their order in the expression.

The calculator operators are listed below in order of precedence (highest to lowest):

f(x)function call
(x+y)parentheses
^ or **exponentiation
! - +unary logical not, unary minus, unary plus (identity operator)
* / %binary multiplication, division, modulus
+ -binary addition, subtraction
< <= >= >arithmetic or string comparison
== !=equality test, inequality test
&&logical and
||logical or

For example, given the high precedence of the exponentiation operator, the following equation:

-3 ^ 2

is interpreted as -(3 ^ 2)

and the result is -9, not 9.

In Automation Process Composer the exponentiation operator (^) binds tighter than the unary minus operator (-). In addition, exponentiation is right associative; while other operators are left associative. For example:

4 ^ 3 ^ 2 === 4 ^ (3 ^ 2)

4 / 3 / 2 === (4 / 3) / 2

The equal symbol (=) is not an operator. When it is used in the Calculator adapter, it indicates an assignment statement.