Commit f2e9c9af authored by Alexander Hirsch's avatar Alexander Hirsch
Browse files

Enumerate operator type support

parent 054e7fe8
......@@ -149,13 +149,23 @@ String literals are at most 1000 characters long.
Arrays are at most `LONG_MAX` elements long.
### Operators
The following table enumerates which types an operator supports.
In the case of a binary operator, both sides must be of the same type.
| Operator | Supported Types |
| ----------------- | ---------------------- |
| `-` `+` `*` `/` | `int`, `float` |
| `<` `<=` `>` `>=` | `int`, `float` |
| `==` `!=` | `bool`, `int`, `float` |
| `!` `&&` `||` | `bool` |
### Special Semantics
#### Boolean
`bool` is considered a first-class citizen, distinct from `int`.
The operators `!`, `&&`, and `||` can only be used with Booleans.
Short-circuit evaluation is *not* supported.
An expression used as a condition (for `if` or `while`) is expected to be of type `bool`.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment