One Neumaier (improved Kahan) compensated-summation step: returns (sum, comp). */
(sum: f64, comp: f64, x: f64)
| 30 | |
| 31 | /* One Neumaier (improved Kahan) compensated-summation step: returns (sum, comp). */ |
| 32 | fn neumaier(sum: f64, comp: f64, x: f64) -> (f64, f64) { |
| 33 | let t = sum + x; |
| 34 | let c = if libm::fabs(sum) >= libm::fabs(x) { (sum - t) + x } else { (x - t) + sum }; |
| 35 | (t, comp + c) |
| 36 | } |
| 37 | |
| 38 | /* `int(s, base)` parsing: optional sign, optional 0x/0o/0b prefix (matching the base, or inferred when base==0), `_` digit separators, radix 0 or 2..=36. */ |
| 39 | // Rounds an integer to -k decimal digits using banker's rounding, matching CPython. |