Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: add concrete decimal numbers to min/max #1728

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/types/numeric.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ r[type.numeric.int]
r[type.numeric.int.unsigned]
The unsigned integer types consist of:

Type | Minimum | Maximum
-------|---------|-------------------
`u8` | 0 | 2<sup>8</sup>-1
`u16` | 0 | 2<sup>16</sup>-1
`u32` | 0 | 2<sup>32</sup>-1
`u64` | 0 | 2<sup>64</sup>-1
`u128` | 0 | 2<sup>128</sup>-1
Type | Minimum | Maximum | Maximum (decimal)
-------|---------|-------------------|------------------------
`u8` | 0 | 2<sup>8</sup>-1 | 255
`u16` | 0 | 2<sup>16</sup>-1 | 65535
`u32` | 0 | 2<sup>32</sup>-1 | 4294967295
`u64` | 0 | 2<sup>64</sup>-1 | 18446744073709551615
`u128` | 0 | 2<sup>128</sup>-1 | ≈ 3.4 x 10<sup>38</sup>

r[type.numeric.int.signed]
The signed two's complement integer types consist of:

Type | Minimum | Maximum
-------|--------------------|-------------------
`i8` | -(2<sup>7</sup>) | 2<sup>7</sup>-1
`i16` | -(2<sup>15</sup>) | 2<sup>15</sup>-1
`i32` | -(2<sup>31</sup>) | 2<sup>31</sup>-1
`i64` | -(2<sup>63</sup>) | 2<sup>63</sup>-1
`i128` | -(2<sup>127</sup>) | 2<sup>127</sup>-1
Type | Minimum | Maximum | Decimal
-------|--------------------|-------------------|----------------------------------------------------
`i8` | -(2<sup>7</sup>) | 2<sup>7</sup>-1 | \[-128..127]
`i16` | -(2<sup>15</sup>) | 2<sup>15</sup>-1 | \[-32768..32767]
`i32` | -(2<sup>31</sup>) | 2<sup>31</sup>-1 | \[-2147483648..2147483647]
`i64` | -(2<sup>63</sup>) | 2<sup>63</sup>-1 | \[-9223372036854775808..9223372036854775807]
`i128` | -(2<sup>127</sup>) | 2<sup>127</sup>-1 | \[≈ -1.7 x 10<sup>38</sup>..≈1.7 x 10<sup>38</sup>]


r[type.numeric.float]
Expand Down