mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-09-20 22:51:58 +00:00
Fixed the test to not use an epsilon
This commit is contained in:
parent
d8a281ef73
commit
4de301e394
3 changed files with 3 additions and 1 deletions
|
@ -42,7 +42,7 @@ fn is_useless_rounding(expr: &Expr) -> Option<(&str, String)> {
|
||||||
} else {
|
} else {
|
||||||
""
|
""
|
||||||
};
|
};
|
||||||
if f.fract() < f64::EPSILON {
|
if f.fract() == 0.0 {
|
||||||
Some((method_name, f_str))
|
Some((method_name, f_str))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|
|
@ -5,4 +5,5 @@ fn main() {
|
||||||
let _ = 1f32;
|
let _ = 1f32;
|
||||||
let _ = 1.0f64;
|
let _ = 1.0f64;
|
||||||
let _ = 1.00f32;
|
let _ = 1.00f32;
|
||||||
|
let _ = 2e-54f64.floor();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,4 +5,5 @@ fn main() {
|
||||||
let _ = 1f32.ceil();
|
let _ = 1f32.ceil();
|
||||||
let _ = 1.0f64.floor();
|
let _ = 1.0f64.floor();
|
||||||
let _ = 1.00f32.round();
|
let _ = 1.00f32.round();
|
||||||
|
let _ = 2e-54f64.floor();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue