MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / neumaier

Function neumaier

compiler/src/modules/vm/builtins/numeric.rs:32–36  ·  view source on GitHub ↗

One Neumaier (improved Kahan) compensated-summation step: returns (sum, comp). */

(sum: f64, comp: f64, x: f64)

Source from the content-addressed store, hash-verified

30
31/* One Neumaier (improved Kahan) compensated-summation step: returns (sum, comp). */
32fn 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.

Callers 1

call_sumMethod · 0.85

Calls 1

fabsFunction · 0.50

Tested by

no test coverage detected