angle_sc

Function two_sum

Source
pub fn two_sum<T>(a: T, b: T) -> (T, T)
where T: Copy + Add<Output = T> + Sub<Output = T>,
Expand description

Calculates floating-point sum and error. The 2Sum algorithm.

  • a, b the floating-point numbers to add.

returns (a + b) and the floating-point error: $t = a + b - (a \oplus b)$
so: $a+b=s+t$.