Skip to content

Commit e981781

Browse files
committed
readme update
1 parent d84e62b commit e981781

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

README.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,22 @@ All operations on integers will either:
2020
* always result in a mathematically correct result, or
2121
* the operation may throws an error that must be caught locally.
2222

23-
### Default integer type (ranged)
24-
Each integer is ranged, and the range can be extended arbitrarilly large. Each
25-
operation will return an integer with a range that encompasses all possible values.
23+
The `int` template type automatically scales to fit the full
24+
result of an operation:
2625

27-
Most operations will increase the range, but a few operations like modulo `%`
28-
, AND `&`, `min()`, `max()` and `clamp()` can reduce the range.
29-
30-
Only a few operations, will require you to catch the error, including:
31-
* division by an integer that may be zero.
32-
* conversion to a smaller integer size.
26+
```
27+
fn foo(x : int[10..=20], y : int[2..=4]) {
28+
// return type is infered as int[20..=80]
29+
return x * y
30+
}
31+
```
3332

34-
These integers are layout compatible with C and C++ types; for example
35-
`int[0..=65535]` is equal to `uint16_t`, and `int[-32768..=32767]` is
36-
equal to `int16_t`.
33+
`int` is the basic integer type and the result of integer literals.
34+
The `int` with proper ranges are compatible with both signed and
35+
unsigned integers with C and C++.
3736

38-
### Dynamically sized integer type
3937
The second integer type is `long`, this integer dynamically scales in size
40-
and is allocated on the heap (it does have short integer optimization).
38+
and is allocated on the heap, and includes SIO (Short Integer Optimization).
4139

4240
## Units system
4341

0 commit comments

Comments
 (0)