Closed
Description
openedon Apr 11, 2017
STR
#![feature(i128_type)]
fn main() {
let x: i128 = -87559967289969187895646876466835277875;
let y: i128 = 84285771033834995895337664386045050880;
let z = x / y;
println!("{}", x);
println!("{}", y);
println!("{}", z);
}
$ cargo run
-87559967289969187895646876466835277875
84285771033834995895337664386045050880
-1
$ cross run --target i686-unknown-linux-gnu
-87559967289969187895646876466835277875
84285771033834995895337664386045050880
-12387103594680423864962518064495067137
This is also wrong at least on i686-pc-windows-msvc. Haven't checked whether the related intrinsic is written in Rust or in C atm. But the implementation in rust-lang-nursery/compiler-builtins gives the right result.
Meta
$ rustc -V
rustc 1.18.0-nightly (3b5754e5c 2017-04-10)
cc @est31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment