Fix clippy error about float comparison

This commit is contained in:
Y. Sapir committed 2019-05-04 23:32:49 +03:00
1 parent 8f3b62ba0e
commit 1a5bddc41b
1 file changed
+1 -1
+1 -1
View File
@@ -397,7 +397,7 @@ impl PyFloat {
};
if ndigits.is_none() {
let fract = self.value.fract();
let value = if fract.abs() == 0.5 {
let value = if (fract.abs() - 0.5).abs() < std::f64::EPSILON {
if self.value.trunc() % 2.0 == 0.0 {
self.value - fract
} else {