about summary refs log tree commit diff
path: root/tests/ui/numbers-arithmetic/apfloat-modulo-wrong.rs
blob: 50e8974fd7c3b31e351c399ed9a78e4bbb0c4399 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ 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());
}