diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2019-07-20 17:57:00 +0200 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2019-07-26 11:29:35 +0200 |
| commit | 65e337cdf3e9a54dbabcdb92aebdfb79b5660e24 (patch) | |
| tree | 6697b3ac7c90f56af6ca4b4cbbface7054716348 /example/std_example.rs | |
| parent | 88ad25f45e9adbf08871ce77449e1b1193d23df4 (diff) | |
| download | rust-65e337cdf3e9a54dbabcdb92aebdfb79b5660e24.tar.gz rust-65e337cdf3e9a54dbabcdb92aebdfb79b5660e24.zip | |
Implement 128bit multiply with overflow
Diffstat (limited to 'example/std_example.rs')
| -rw-r--r-- | example/std_example.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/example/std_example.rs b/example/std_example.rs index a67ca2f79c7..9e9a7a67e05 100644 --- a/example/std_example.rs +++ b/example/std_example.rs @@ -22,4 +22,9 @@ fn main() { checked_div_i128(0i128, 2i128); checked_div_u128(0u128, 2u128); assert_eq!(1u128 + 2, 3); + + println!("{}", 0b100010000000000000000000000000000u128 >> 10); + println!("{}", 0xFEDCBA987654321123456789ABCDEFu128 >> 64); + println!("{} >> 64 == {}", 0xFEDCBA987654321123456789ABCDEFu128 as i128, 0xFEDCBA987654321123456789ABCDEFu128 as i128 >> 64); + println!("{}", 353985398u128 * 932490u128); } |
