Expression Operators
- Last UpdatedSep 22, 2017
- 2 minute read
The following table lists the expression operators that you can use.
|
Symbol |
Operator |
Description |
|---|---|---|
|
~ |
Complement |
Yields the one's complement of a 32-bit integer. |
|
() |
Parenthesis |
Use parenthesis to create logical sub-expressions and control operator precedence. |
|
- |
Negation |
Negates value of the next operand. |
|
NOT |
Logical NOT |
Negates the result of the Boolean expression within the parenthesis. |
|
+ |
Addition and concatenation |
Adds values of the previous and next operands. |
|
- |
Subtraction |
Subtracts value of previous operand by next operand. |
|
& |
Bitwise AND |
Compares 32-bit integer words with each other, bit for bit. |
|
* |
Multiplication |
Multiplies values of the previous and next operands. |
|
** |
Power |
Returns the result of the previous (numerical) operand (the base) raised to the power of the next (numerical) operand (the power). |
|
/ |
Division |
Divides the value of the previous operand by the next operand. |
|
^ |
Exclusive OR |
Compares the status of bits in corresponding locations. If the corresponding bits are the same, a zero is the result. If the corresponding bits differ, a one is the result. |
|
| |
Inclusive OR |
Examines the corresponding bits for a one condition. If either bit is a one, the result is a one. Only when both corresponding bits are zeros is the result a zero. |
|
< |
Less than |
True if the previous operand is less than next operand; otherwise, it is False. |
|
<= |
Less than or equal to |
True if the previous operand is less than or equal to next operand; otherwise, it is False. |
|
<> |
Not equal to |
True if the previous operand is not equal to the next operand; otherwise, it is False. |
|
== |
Equivalency (is equivalent to) |
True if the previous operand is equal to the next operand; otherwise, it is False. |
|
> |
Greater than |
True if the previous operand is greater than the next operand; otherwise, it is False. |
|
>= |
Greater than or equal to |
True if the previous operand is greater than or equal to the next operand; otherwise, it is False. |
|
AND |
Logical AND |
True if the previous operand and the next operand are True; otherwise, it is False. |
|
MOD |
Modulo |
Divides an integer quantity to its left by an integer quantity to its right. The remainder of the quotient is the result of the MOD operation. |
|
OR |
Logical OR |
True if the previous operand or the next operand is True; otherwise, it is False. |
|
SHL |
Left shift |
Shifts the bits of the previous operand left by the number of positions specified by the second operand. Bits that would end up at position greater than 32 are (dropped/wrapped around to the first set of positions). |
|
SHR |
Right shift |
Shifts the bits of the previous operand right by the number of positions specified by the second operand. Bits that would end up at position greater than 32 are (dropped/wrapped around to the first set of positions). |
NOTE: The expression is evaluated to true/false. During the evaluation, it internally converts the value to an appropriate type (as needed) with the final value being a Boolean result. Using variables with unexpected data types for portions of an expression can result in “less meaningful” evaluation results.