Expression operators
Expression operators are mainly arithmetic operators that take numeric values as arguments. There is also one expression operator that takes textual arguments. Results of expression operators are numeric or textual values. They can be reused as arguments in an expression. Logical operators take integer arguments that are interpreted as bit sets. The operation is performed on the bits, and the result is interpreted as an integer value.
The operators are listed in groups. All operators within the same group are evaluated at the same time, when they appear in an expression without parentheses. Operators from earlier groups are evaluated before operators from later groups.
Example of expression evaluation order
$E1 + $E2 * $E3
This expression is evaluated as ($E1+($E2*$E3))
. The *
is evaluated before the +
, because the *
is in the second group, while the +
is in the third group.
Exponentiation and special division operators
Exponentiation and special division operators take two numeric arguments and produce a numeric result.
| Value of |
| Value of |
| Remainder of division of |
| Modulo of division of |
Multiplicative operators
Multiplicative operators take two numeric arguments and produce a numeric result.
| Value of |
| Value of |
| Integer division of |
| Bitwise right shift of |
| Bitwise left shift of |
Additive operators
Additive operators take two numeric arguments and produce a numeric result.
| The sum of |
| Value of |
| Bitwise conjunction ( |
| Bitwise inclusive disjunction ( |
| Bitwise exclusive disjunction ( |
Single numeral operators
These operators take a single numeric argument and produce a numeric result.
| The value |
| The numeric negation of the value |
| The logical or bitwise negation (complement) of the value |
Concatenation operator
The following operator takes two string arguments and produces a string result.
| Concatenation of string |
Expression operator example
$E.msg = 'Host ' || $E.mc_host || ' went down';
Comments
Log in or register to comment.