mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 11:14:38 +08:00
Fix clippy error about float comparison
This commit is contained in:
1 parent
8f3b62ba0e
commit
1a5bddc41b
1 file changed
+1
-1
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user