# Operators
# Arithmetic operators
| Operator | Description | Complexity |
|---|---|---|
| + | Addition | 1 for Int 1 for BigInt in Standard library version 8 8 for BigInt in Standard library version 7 and 6 1 for String 2 for ByteVector |
| - | Subtraction | 1 for Int 1 for BigInt in Standard library version 8 8 for BigInt in Standard library version 7 and 6 |
| * | Multiplication | 1 for Int 1 for BigInt in Standard library version 8 64 for BigInt in Standard library version 7 and 6 |
| / | Division | 1 for Int 1 for BigInt in Standard library version 8 64 for BigInt in Standard library version 7 and 6 |
| % | Remainder | 1 for Int 1 for BigInt in Standard library version 8 64 for BigInt in Standard library version 7 and 6 |
| - | Unary minus | 1 for Int 1 for BigInt in Standard library version 8 8 for BigInt in Standard library version 7 and 6 |
Please note:
The / operator uses the FLOOR rounding method, see Rounding variables. For example, the result of
-1 / 100is-1.Minus with a space after it is always considered a binary operator. For example, the code
let b = 100 - 100defines the variable
band sets its to 0.Minus placed at the beginning of a line or element with no space after it is considered a unary operator. For example, the code
let b = 100 -100is an expression whose value is -100.
# Comparison operators
| Operator | Description | Complexity |
|---|---|---|
| < | Less than | 1 for Int 1 for BigInt in Standard library version 8 8 for BigInt in Standard library version 7 and 6 |
| > | Greater than | 1 for Int 1 for BigInt in Standard library version 8 8 for BigInt in Standard library version 7 and 6 |
| <= | Less than or equal | 1 for Int 1 for BigInt in Standard library version 8 8 for BigInt in Standard library version 7 and 6 |
| >= | Greater than or equal | 1 for Int 1 for BigInt in Standard library version 8 8 for BigInt in Standard library version 7 and 6 |
| == | Equality | 1 |
| != | Inequality | 1 |
# Local definition operators
| Operator | Description | Complexity |
|---|---|---|
| func | Function local definition | 0* |
| let | Lazy definition of a variable | 0 |
| strict | Strict definition of a variable | 1 or 2* |
* Any function call has a complexity of at least 1. See the Complexity article for more information.
** See the Variables article for more information.
# Conditional operators
| Operator | Description | Complexity |
|---|---|---|
| if ... then ... else | Conditional statement | 0* |
| match ... case | Pattern matching | Number of case |
* See the Complexity article for more information.
# List operators
| Operator | Description | Complexity |
|---|---|---|
| ++ | Concatenation | 4 |
| :+ | Adding the element to the end of the list | 1 |
| :: | Adding the element to the beginning of the list | 1 |
See examples in the List article.
# Logical operators
| Operator | Description | Complexity |
|---|---|---|
| && | Logical AND | 0 |
| || | Logical OR | 0 |
| ! | Logical negation | 1 |
Please note: logical operators only work with values of Boolean type. Int values are not supported.