mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +09:00
Fix clippy error about float comparison
This commit is contained in:
@@ -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