Closed
Description
Hello,
It seems to me that clippy should allow the results of two calls to f{32, 64}::signum()
to be compared, e.g a contrived example:
fn signs_agree(f1: f64, f2: f64) -> bool {
return f1.signum() == f2.signum()
}
results in:
error: strict comparison of f32 or f64
--> src/main.rs:3:4
|
3 | f1.signum() == f2.signum()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(f1.signum() - f2.signum()).abs() < error`
|
= note: #[deny(clippy::float_cmp)] on by default
note: std::f32::EPSILON and std::f64::EPSILON are available.
--> src/main.rs:3:4
|
3 | f1.signum() == f2.signum()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#float_cmp