| General Information | |
| Operator | + |
| Type | binary |
| Syntax | expr + expr |
| Commutative | yes |
| Operand Types | integer, float, char, string, list, bag, set, array |
| Result Type | see following table |
| Function | multi functions according to operands: arithmetic addition, string concatenation, list or array concatenation, set or bag union. |
| Possible Operand Combinations | |||
| first operand type | second operand type | result type | |
| integer | integer | integer | |
| integer | float | float | |
| char | char | integer | |
| char | integer | integer | |
| char | float | float | |
| float | float | float | |
| string | string | string | string concatenation |
| list | list | list | list concatenation |
| array | array | array | array concatenation |
| set | set | set | set union |
| bag | bag | bag | bag union |
| Expression Examples | |
| expression | result |
| 1 + 2 | 3 |
| 1 + 2. | 3. |
| 2 + 2.3 | 4.3 |
| 'a' + 'b' | 195 |
| 'a' + 1.2 | 98.200 |
| "hello" + "world" | "helloworld" |
| list(1, 2, 3) + list(2, 3, 4) | list(1, 2, 3, 2, 3, 4) |
| set(1, 2, 3) + set(2, 3, 4) | set(1, 2, 3, 4) |
| 1 + "hello" | raises an error |
| set(1, 2, 3) + list(2, 3, 4) | raises an error |
| General Information | |
| Operators | - |
| * | |
| / | |
| Type | binary |
| Syntaxes | expr - expr |
| expr * expr | |
| expr / expr | |
| Commutative | - : no |
| * : yes | |
| / : no | |
| Operand Types | integer, float, char |
| Result Type | see following table |
| Functions | - : substract |
| * : multiply | |
| / : divide | |
| Possible Operand Combinations | ||
| first operand type | second operand type | result type |
| integer | integer | integer |
| integer | float | float |
| integer | char | integer |
| char | char | integer |
| char | integer | integer |
| char | float | float |
| float | float | float |
| float | integer | float |
| float | char | float |
| Expression Examples | |
| expression | result |
| 1 - 2 | -1 |
| 3 * 2. | 6. |
| 2 * 'a' | 194 |
| 'a' * 'b' | 9506 |
| 1 / 2 | 0 |
| 1 / 2. | .5000 |
| 1. / 2 | .5000 |
| 1. / 2 | .5000 |
| "hello" * "world" | raises an error |
| 1 - "hello" | raises an error |
| General Information | |
| Operators | « |
| » | |
| % | |
| & | |
| | | |
| ^ | |
| Type | binary |
| Syntaxes | expr « expr |
| expr » expr | |
| expr % expr | |
| expr & expr | |
| expr | expr | |
| expr ^ expr | |
| Commutative | « : no |
| » : no | |
| % : no | |
| & : yes | |
| | : yes | |
| ^ : yes | |
| Operand Types | integer, char |
| Result Type | integer |
| Functions | « : left shift |
| » : right shift | |
| % : modulo | |
| & : bitwise and | |
| | : bitwise or | |
| ^ : bitwise exclusive or | |
| Expression Examples | |
| expression | result |
| 1 « 4 | 16 |
| 100 » 2 | 25 |
| 100 % 13 | 9 |
| 0xf12 & 0xf | 2 |
| 0xf12 | 0xf | 3871 |
| 0xf12 ^ 0xf | 3869 |
| 'b' % '9' | 8 |
| 2 « 1.2 | raises an error |
| 2 % 3.4 | raises an error |
| 2.1 % 3 | raises an error |
| General Information | |
| Operators | + |
| - | |
| Type | unary |
| Syntaxes | + expr |
| - expr | |
| Operand Types | integer, char, float |
| Result Type | see following table |
| Functions | sign operator |
| Possible Operand Combinations | |
| operand type | result type |
| integer | integer |
| float | float |
| char | integer |
| Expression Examples | |
| expression | result |
| +12 | 12 |
| -100 | -100 |
| -123.4 | -123.4 |
| +'a' | 97 |
| -'a' | -97 |
| +"hello" | raises an error |
| -null" | raises an error |
| General Information | |
| Operator | ~ |
| Type | unary |
| Syntax | ~ expr |
| Operand Types | integer, char |
| Result Type | integer |
| Functions | bitwise complement |
| Expression Examples | |
| expression | result |
| ~112 | -113 |
| ~0 | -1 |
| ~'a' | -98 |
| ~2.3 | raises an error |
| ~"hello" | raises an error |