[][src]Trait kahan::KahanSummator

pub trait KahanSummator<T: Float> {
    fn kahan_sum(self) -> KahanSum<T>;
}

Required methods

fn kahan_sum(self) -> KahanSum<T>

Computes the Kahan sum of an iterator.

Example

let summands = [10000.0f32, 3.14159, 2.71828];
let kahan_sum = summands.iter().kahan_sum();
assert_eq!(10005.86f32, kahan_sum.sum());
assert_eq!(0.0004813671f32, kahan_sum.err());
Loading content...

Implementors

impl<T, U, V> KahanSummator<T> for U where
    U: Iterator<Item = V>,
    V: Borrow<T>,
    T: Float
[src]

Loading content...