Closed
Description
The following tests do not pass for me, but I think they should, as comparisons with NaN should always simply evaluate to false
:
#[test]
fn test_zero_zero() {
assert_eq!(0.0/0.0 < 0.0/0.0, false);
assert_eq!(0.0/0.0 > 0.0/0.0, false);
}
#[test]
fn test_nan_nan() {
assert_eq!(std::f64::NAN < std::f64::NAN, false);
assert_eq!(std::f64::NAN > std::f64::NAN, false);
}
fn main() {
println!("Hello, world!");
}
I get this result on both debug and release builds. I'm on an x86_64 running Linux, rustc 1.27.0-nightly (f0fdaba 2018-05-15).
Metadata
Metadata
Assignees
Labels
Area: Constant evaluation, covers all const contexts (static, const fn, ...)Category: This is a bug.Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessHigh priorityRelevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from one stable version to another.