Skip to content

Commit

Permalink
Add test case for rust-lang#109567
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyukang authored and wesleywiser committed Jul 26, 2023
1 parent 47a4484 commit 98dd81e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/ui/numbers-arithmetic/apfloat-modulo-wrong.rs
Original file line number Diff line number Diff line change
@@ -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());
}

0 comments on commit 98dd81e

Please sign in to comment.