Skip to content

Commit 8fd038a

Browse files
committed
update operators
1 parent c0392ae commit 8fd038a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/introduction/operators.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ Arithmetic operators are used to perform common mathematical operations. And som
1616
| `++` | Equals to += 1 as suffix | lvalue arithmetic++ |
1717
| `--` | Equals to -= 1 as suffix | lvalue arithmetic-- |
1818

19+
## Integer Overflow
20+
21+
Integer overflow is not checked in any way in Jule. To detect an integer overflow, Jule developers must place mechanisms such as assert in suspicious locations or implement the necessary runtime checks themselves.
22+
23+
Unsigned integer values ​​are handled the same way in Go.\
24+
From Go Language Specification:
25+
> For unsigned integer values, the operations +, -, *, and << are computed modulo 2n, where n is the bit width of the unsigned integer's type. Loosely speaking, these unsigned integer operations discard high bits upon overflow, and programs may rely on "wrap around".
26+
1927
## Comparison Operators
2028

2129
| Operator | Description |
@@ -52,9 +60,4 @@ For binded types, all binded structures accepted as non-comparable. Other type a
5260
| 4 | `+` `-` `\|` `^` |
5361
| 3 | `==` `!=` `<` `<=` `>` `>=` |
5462
| 2 | `&&` |
55-
| 1 | `\|\|` |
56-
57-
58-
## Integer Overflow
59-
60-
Integer overflow is not checked in any way in Jule. This can be a significant cost in runtime and can significantly impact performance. To detect an integer overflow, Jule developers must place mechanisms such as assert in suspicious locations or implement the necessary runtime checks themselves.
63+
| 1 | `\|\|` |

0 commit comments

Comments
 (0)