Logic and arithmetic operators
- Last UpdatedAug 07, 2026
- 2 minute read
The Built-in Language supports the following logic and arithmetic operators.
Logic operators
Basic logic operators are supported as explained in the following table. Use the Logical and Loop functions for more complex logic operations.
|
Operator |
Usage |
Description |
|---|---|---|
|
AND |
A AND B |
TRUE if A and B are both TRUE |
|
OR |
A OR B |
TRUE if A is TRUE, or B is TRUE, or both |
|
XOR |
A XOR B |
TRUE if A is TRUE, or B is TRUE, but not both |
|
NOT |
NOT A |
TRUE if A is FALSE |
|
= |
X = Y |
TRUE if X is equal to Y |
|
> |
X > Y |
TRUE if X is greater than Y |
|
>= |
X >= Y |
TRUE if X is greater than or equal to Y |
|
< |
X < Y |
TRUE if X is less than Y |
|
<= |
X <= Y |
TRUE if X is less than or equal to Y |
|
<> |
X <> Y |
TRUE if X is not equal to Y |
|
& |
X & Y |
Bitwise AND: 0101 (decimal 5) AND 0011 (decimal 3) = 0001 (decimal 1) |
|
| |
X | Y |
Bitwise OR: 0101 (decimal 5) OR 0011 (decimal 3) = 0111 (decimal 7) |
|
^ |
X ^ Y |
Bitwise XOR: 0101 (decimal 5) XOR 0011 (decimal 3) = 0110 (decimal 6) |
|
~ |
~ X |
Bitwise NOT: NOT 0101 (decimal 5) = 1010 (decimal 10) |
|
>> n |
X >> Y |
Rotate n bits to right: 0110 (decimal 6) ROTATE RIGHT = 0011 (decimal 3) |
|
<< n |
X << Y |
Rotate n bits to left: 0110 (decimal 6) ROTATE LEFT = 1100 (decimal 12) |
Arithmetic operators
|
Operator |
Usage |
Description |
|---|---|---|
|
+ |
X + Y |
Add (plus) |
|
- |
X - Y |
Subtract (minus) |
|
* |
X * Y |
Multiply by |
|
/ |
X / Y |
Divide by |
Arithmetic operators are resolved according to the standard order of operations. To change the order, enclose in parentheses the part of the expression to be resolved first. For example, the following expression gives a result of 11 because multiplication is resolved before addition:
5+2*3
If you enclose the addition in parentheses, so that it is resolved before the multiplication, the expression gives a result of 21:
(5+2)*3
For more complex math, use the Arithmetic, Statistical, Logarithmic and Trigonometric functions.