The following are the set of built-in unary, binary and conditional operators
not provides the boolean negation, e.g.
not true is
- provides the negative of a number, e.g.
The binary operators are:
+is the addition operator for numbers. It can also be used to concatenate strings.
-is the subtraction operator for numbers.
*is the mutiplication operator for numbers.
/is the division operator for numbers. It can return an error when dividing a number by zero.
%is the mod operator for numbers.
==is the equality operator and can be used for numbers, strings, and temporal types, e.g.
2 == 2is
<=is the less or equal to operator and can be used for numbers, strings, and temporal types.
<is the less operator and can be used for numbers, strings, and temporal types.
>=is the greater or equal to operator and can be used for numbers, strings, and temporal types.
>is the greater operator and can be used for numbers, strings, and temporal types.
Strings are compared lexicographically.
Temporal types must be of the same type: e.g. a date can only be compared to another date type, and not to a time or timestamp type.
andis the logical and boolean operator, e.g.
true and falseis
oris the logical or boolean operator, e.g.
true or falseis
To check for a condition use
if <condition> then <exp1> else <exp2>.
if (true) then "1" else "2"
Note that both the expressions in
then and in
else must be of the two compatible types. For instance
if (true) then 1 else 2f
The following is an expression of type float: even though
1 which has type int, the
2f which has type
float. Since an
int can be upcasted to a
float, then the result type is