Skip to content

Commit

Permalink
Rust unstable book: basic desc and example for i128_type.
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Mar 14, 2017
1 parent 0dd03ff commit 137c1e8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/doc/unstable-book/src/i128-type.md
Expand Up @@ -6,5 +6,20 @@ The tracking issue for this feature is: [#35118]

------------------------

The `i128_type` feature adds support for 128 bit signed and unsigned integer
types.

```rust
#![feature(i128_type)]

fn main() {
assert_eq!(1u128 + 1u128, 2u128);
assert_eq!(u128::min_value(), 0);
assert_eq!(u128::max_value(), 340282366920938463463374607431768211455);

assert_eq!(1i128 - 2i128, -1i128);
assert_eq!(i128::min_value(), -170141183460469231731687303715884105728);
assert_eq!(i128::max_value(), 170141183460469231731687303715884105727);
}
```

0 comments on commit 137c1e8

Please sign in to comment.