mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-24 12:54:00 +00:00
Add test case for #109567
This commit is contained in:
parent
47a4484a78
commit
98dd81e4e3
15
tests/ui/numbers-arithmetic/apfloat-modulo-wrong.rs
Normal file
15
tests/ui/numbers-arithmetic/apfloat-modulo-wrong.rs
Normal file
@ -0,0 +1,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());
|
||||
}
|
Loading…
Reference in New Issue
Block a user