mirror of
https://github.com/rust-lang/book.git
synced 2026-12-01 01:41:21 -06:00
Merge pull request #268 from 0xmohit/i8-upper-bound
fix upper bound for i8
This commit is contained in:
@@ -319,7 +319,7 @@ outside the scope of this text).
|
||||
|
||||
Each signed variant can store numbers from -(2<sup>n - 1</sup>) to 2<sup>n -
|
||||
1</sup> - 1 inclusive, where `n` is the number of bits that variant uses. So an
|
||||
`i8` can store from -(2<sup>7</sup>) to 2<sup>7</sup>, which equals -128
|
||||
`i8` can store from -(2<sup>7</sup>) to 2<sup>7</sup> - 1, which equals -128
|
||||
to 127. Unsigned variants can store numbers from 0 to 2<sup>n</sup> - 1, so a
|
||||
`u8` can store from 0 to 2<sup>8</sup> - 1, which equals 0 to 255.
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ outside the scope of this text).
|
||||
|
||||
Each signed variant can store numbers from -(2<sup>n - 1</sup>) to 2<sup>n -
|
||||
1</sup> - 1 inclusive, where `n` is the number of bits that variant uses. So an
|
||||
`i8` can store from -(2<sup>7</sup>) to 2<sup>7</sup>, which equals -128
|
||||
`i8` can store from -(2<sup>7</sup>) to 2<sup>7</sup> - 1, which equals -128
|
||||
to 127. Unsigned variants can store numbers from 0 to 2<sup>n</sup> - 1, so a
|
||||
`u8` can store from 0 to 2<sup>8</sup> - 1, which equals 0 to 255.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user