| General Information |
| Operators |
< |
| |
<= |
| |
> |
| |
>= |
| Type |
binary |
| Syntaxes |
expr < expr |
| |
expr <= expr |
| |
expr > expr |
| |
expr >= expr |
| Commutative |
no |
| Operand Types |
integer, float, char, string, list, array, set,
bag |
| Result Type |
boolean |
| Functions |
the function depends on the operands: |
| |
< : less than or is included in |
| |
<= : less than or equal or is included in or equal |
| |
> : greater than or contains |
| |
>= : greater than or equal or contains or equal |
| Possible Operand Combinations |
| first operand type |
second operand type |
result type |
comments |
| integer, char, float |
integer,
char, float |
boolean |
performs an arithmetic
comparison |
| string |
string |
boolean |
performs an alpha-numeric comparison |
| set |
set |
boolean |
performs an inclusion comparison |
| bag |
bag |
boolean |
performs an inclusion comparison |
| set |
bag |
boolean |
performs an inclusion comparison: the set operand is converted to a
bag |
| bag |
set |
boolean |
performs an inclusion comparison: the set operand is converted to a
bag |
| list |
list |
boolean |
performs a term-to-term polymorphic (i.e. numeric, alpha-numeric or inclusion)
comparison |
| array |
array |
boolean |
performs a term-to-term polymorphic comparison |
Note that in case of different operand types, an automatic promotion is
done to the more precise type.
| Expression Examples |
| expression |
result |
| 1 < 2 |
true |
| 1 >= 2 |
false |
| 2. <= 2 |
true |
| "hello" < "world" |
true |
| "hello" >= "world" |
false |
| list(1, 2) < list(2, 3) |
true |
| list(1, 2) < list(0, 3) |
false |
| list(1, 2) < list(0, 3, 2) |
false |
| list(0, 3, 2) >= list(1, 2) |
false |
| list(1, 2) < list(2, 3, 3) |
true |
| list(1, 2) < list(0) |
false |
| set(1, 2) < set(2, 4, 44) |
false |
| set(1, 2) < set(2, 1, 44) |
true |
| "hello" >= 3 |
raises an error |
| list(1, 2) < array(2, 4, 44) |
raises an error |
| set(1, 2) < bag(2, 1, 44) |
raises an error |