mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
Format
This commit is contained in:
@@ -453,11 +453,11 @@ fn math_fsum(iter: PyIterable<IntoPyFloat>, vm: &VirtualMachine) -> PyResult<f64
|
||||
let y = lo + lo;
|
||||
let x = hi + y;
|
||||
|
||||
/* Make half-even rounding work across multiple partials.
|
||||
Needed so that sum([1e-16, 1, 1e16]) will round-up the last
|
||||
digit to two instead of down to zero (the 1e-16 makes the 1
|
||||
slightly closer to two). With a potential 1 ULP rounding
|
||||
error fixed-up, math.fsum() can guarantee commutativity. */
|
||||
// Make half-even rounding work across multiple partials.
|
||||
// Needed so that sum([1e-16, 1, 1e16]) will round-up the last
|
||||
// digit to two instead of down to zero (the 1e-16 makes the 1
|
||||
// slightly closer to two). With a potential 1 ULP rounding
|
||||
// error fixed-up, math.fsum() can guarantee commutativity.
|
||||
#[allow(clippy::float_cmp)]
|
||||
if y == x - hi {
|
||||
hi = x;
|
||||
|
||||
Reference in New Issue
Block a user