rust/tests/ui/numbers-arithmetic/apfloat-modulo-wrong.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
331 B
Rust
Raw Normal View History

2023-03-24 16:59:57 +00:00
//@ run-pass
//@ check-run-results
// regression test for issue #109567
fn f() -> f64 {
std::hint::black_box(-1.0) % std::hint::black_box(-1.0)
}
const G: f64 = -1.0 % -1.0;
pub fn main() {
assert_eq!(-1, G.signum() as i32);
assert_eq!((-0.0_f64).to_bits(), G.to_bits());
assert_eq!(f().signum(), G.signum());
}