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

Add 128-bit ints to ch3 #1230

Merged
merged 4 commits into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions second-edition/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ CPUs
cratesio
CRLF
cryptocurrencies
cryptographic
cryptographically
CStr
CString
Expand Down Expand Up @@ -227,6 +228,7 @@ libreoffice
libstd
lifecycle
LimitTracker
LLVM
lobally
locators
LockResult
Expand Down Expand Up @@ -272,6 +274,7 @@ namespace
namespaced
namespaces
namespacing
natively
newfound
NewJob
NewsArticle
Expand Down
15 changes: 15 additions & 0 deletions second-edition/src/appendix-06-newest-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,18 @@ fn main() {

The `...` syntax is still accepted in matches, but it is not accepted in
expressions. `..=` should be preferred.

## 128-bit integers

Rust 1.26.0 added 128-bit integer primitives:

- `u128`: A 128-bit unsigned integer with range [0, 2^128 - 1]
- `i128`: A 128-bit signed integer with range [-(2^127), 2^127 - 1]

These primitive are implemented efficiently via LLVM support. They
are available even on platforms that don't natively support 128-bit
integers and can be used like the other integer types.

These primitives can be very useful for algorithms that need to use
very large integers efficiently, such as certain cryptographic
algorithms.