Skip to content

Commit

Permalink
Update operators
Browse files Browse the repository at this point in the history
Signed-off-by: Heinz N. Gies <[email protected]>
  • Loading branch information
Licenser committed Oct 24, 2023
1 parent 3205da1 commit f126935
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/language/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,20 +243,25 @@ See also:

List of binary and unary operators in Tremor, ordered by precedence (from low to high):

### Binary Operators

| Symbol | Name | Example | Types | Fold Support |
|--------------|-----------------------------------------------|---------------------------------------------------------|--------------------------------|--------------|
| or | Logical OR | `true or false` | bool | no |
| and | Logical AND | `true and false` | bool | no |
| or | Logical OR (short circuiteing) | `true or false` | bool | yes |
| and | Logical AND (short circuiteing) | `true and false` | bool | yes |
| xor | Logical XOR | `true xor false` | bool | yes |
| \| | Bitwise OR | _Bitwise OR has not been implemented yet_ | - | no |
| ^ | Bitwise XOR | `42 ^ 42, true ^ true` | integer, bool | yes |
| & | Bitwise AND | `42 & 0, true & false` | integer, bool | yes |
| ==, != | Equality, Inequality | `"snot" != "badger"` | all | no |
| <, <=, >, >= | Comparison Operators | `42 > 0` | integer, float, string, binary | no |
| <<, >>, >>> | Bitwise shift: Left, Right(signed & unsigned) | `42 >> 2` | integer | no |
| <<, >>, >>> | Bitwise shift: Left, Right(signed & unsigned) | `42 >> 2` | integer | yes |
| + | Addition | `42 + 0` | all | yes |
| - | Subtraction | `42 - 0` | integer, float, string | yes |
| \*, / | Multiplication, Division | `42 * 1` | integer, float | yes |
| % | Modulus | `42 % 2` | integer | yes |

### Unary Operators
| +, - | Unary Plus, Unary Minus | `-42` | integer, float | no |
| not , ! | Unary Logical NOT, Unary Bitwise NOT | `not false`, _Bitwise NOT has not been implemented yet_ | bool | no |

Expand Down

0 comments on commit f126935

Please sign in to comment.