Operators
- Last UpdatedJun 16, 2017
- 1 minute read
|
Operator |
Syntax |
Returns |
|---|---|---|
|
+ |
value1 + value2 |
The sum of value1 and value2 |
|
% |
value1 % value2 |
The remainder of value1 divided by value2 |
|
- |
value1 - value2 |
The result of value2 subtracted from value1 |
|
^ |
value1 ^ value2 |
The result of value1 raised to the power of value2 |
|
! |
!expr |
Inverts the value of expr. For example, "!(3>5)" would return TRUE, as the statement "3 is NOT greater than 5" is true. |
|
* |
value1 * value2 |
The result of value1 multiplied by value2 |
|
/ |
value1 / value2 |
The result of value1 divided by value2 |
|
< |
value1 < value2 |
TRUE if value1 is less than value2, FALSE if not |
|
<= |
value1 <= value2 |
TRUE if value1 is less than or equal to value2, FALSE if not |
|
<> |
value1 <> value2 |
FALSE if value1 is equal to value2, TRUE if value1 is not equal to value2 |
|
= |
Expr1 = Expr2 |
TRUE if Expr1 is equal to Expr2, FALSE if not |
|
> |
value1 > value2 |
TRUE if value1 is greater than value2, FALSE if not |
|
>= |
value1 >= value2 |
TRUE if value1 is greater than or equal to value2, FALSE if not |
|
AND |
Expr1 AND Expr2 |
TRUE only if both Expr1 and Expr2 are true, and FALSE otherwise |
|
NAND |
expr1 NAND expr2 |
FALSE if both expr1 and expr2 are true, TRUE otherwise |
|
NOR |
expr1 NOR expr2 |
TRUE if both expr1 and expr2 are false, FALSE otherwise |
|
OR |
expr1 OR expr2 |
FALSE if both expressions are false, TRUE otherwise |
|
XOR |
Expr1 XOR Expr2 |
TRUE if only one of Expr1 and Expr2 are true, FALSE otherwise |