2017-09-18 10:47:33 +00:00
|
|
|
|
|
|
|
|
2015-05-04 12:11:15 +00:00
|
|
|
|
2017-05-17 12:19:44 +00:00
|
|
|
#[warn(cmp_nan)]
|
2016-05-13 14:43:47 +00:00
|
|
|
#[allow(float_cmp, no_effect, unnecessary_operation)]
|
2015-05-04 12:11:15 +00:00
|
|
|
fn main() {
|
2015-08-11 18:22:20 +00:00
|
|
|
let x = 5f32;
|
2017-02-08 13:58:07 +00:00
|
|
|
x == std::f32::NAN;
|
|
|
|
x != std::f32::NAN;
|
|
|
|
x < std::f32::NAN;
|
|
|
|
x > std::f32::NAN;
|
|
|
|
x <= std::f32::NAN;
|
|
|
|
x >= std::f32::NAN;
|
2015-05-04 12:11:15 +00:00
|
|
|
|
2015-08-11 18:22:20 +00:00
|
|
|
let y = 0f64;
|
2017-02-08 13:58:07 +00:00
|
|
|
y == std::f64::NAN;
|
|
|
|
y != std::f64::NAN;
|
|
|
|
y < std::f64::NAN;
|
|
|
|
y > std::f64::NAN;
|
|
|
|
y <= std::f64::NAN;
|
|
|
|
y >= std::f64::NAN;
|
2015-05-04 12:11:15 +00:00
|
|
|
}
|