|
1 | 1 | # Numeric types
|
2 | 2 |
|
3 |
| -## Machine types |
| 3 | +## Integer types |
4 | 4 |
|
5 |
| -The machine types are the following: |
| 5 | +The unsigned integer types consist of: |
6 | 6 |
|
7 |
| -* The unsigned word types `u8`, `u16`, `u32`, `u64`, and `u128` with values |
8 |
| - drawn from the integer intervals [0, 2^8 - 1], [0, 2^16 - 1], [0, 2^32 - 1], |
9 |
| - [0, 2^64 - 1], and [0, 2^128 - 1] respectively. |
| 7 | +Type | Minimum | Maximum |
| 8 | +-------|---------|------------------- |
| 9 | +`u8` | 0 | 2<sup>8</sup>-1 |
| 10 | +`u16` | 0 | 2<sup>16</sup>-1 |
| 11 | +`u32` | 0 | 2<sup>32</sup>-1 |
| 12 | +`u64` | 0 | 2<sup>64</sup>-1 |
| 13 | +`u128` | 0 | 2<sup>128</sup>-1 |
10 | 14 |
|
11 |
| -* The signed two's complement word types `i8`, `i16`, `i32`, `i64`, and `i128`, |
12 |
| - with values drawn from the integer intervals [-(2^7), 2^7 - 1], |
13 |
| - [-(2^15), 2^15 - 1], [-(2^31), 2^31 - 1], [-(2^63), 2^63 - 1], and |
14 |
| - [-(2^127), 2^127 - 1] respectively. |
| 15 | +The signed two's complement integer types consist of: |
15 | 16 |
|
16 |
| -* The IEEE 754-2008 "binary32" and "binary64" floating-point types: `f32` and |
17 |
| - `f64`, respectively. |
| 17 | +Type | Minimum | Maximum |
| 18 | +-------|--------------------|------------------- |
| 19 | +`i8` | -(2<sup>7</sup>) | 2<sup>7</sup>-1 |
| 20 | +`i16` | -(2<sup>15</sup>) | 2<sup>15</sup>-1 |
| 21 | +`i32` | -(2<sup>31</sup>) | 2<sup>31</sup>-1 |
| 22 | +`i64` | -(2<sup>63</sup>) | 2<sup>63</sup>-1 |
| 23 | +`i128` | -(2<sup>127</sup>) | 2<sup>127</sup>-1 |
| 24 | + |
| 25 | + |
| 26 | +## Floating-point types |
| 27 | + |
| 28 | +The IEEE 754-2008 "binary32" and "binary64" floating-point types are `f32` and |
| 29 | +`f64`, respectively. |
18 | 30 |
|
19 | 31 | ## Machine-dependent integer types
|
20 | 32 |
|
|
0 commit comments