Struct accurate::OnlineExactSum
[−]
[src]
pub struct OnlineExactSum<F> {
// some fields omitted
}Calculates a sum using separate accumulators for each possible exponent
Examples
use accurate::*; let s = OnlineExactSum::default() + 1.0 + 2.0 + 3.0; assert_eq!(6.0f64, s.sum());
References
Based on Zhu and Hayes 10
Trait Implementations
impl<F: Clone> Clone for OnlineExactSum<F>[src]
fn clone(&self) -> OnlineExactSum<F>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl<F> SumAccumulator<F> for OnlineExactSum<F> where F: Float + Ieee754Ext, F::Significand: PrimInt, F::RawExponent: PrimInt[src]
fn sum(&self) -> F
The sum of all terms accumulated so far
fn absorb<I>(self, it: I) -> Self where I: IntoIterator<Item=F>
Absorb the items of an iterator into the accumulator Read more
impl<F> Add<F> for OnlineExactSum<F> where F: Float + Ieee754Ext, F::RawExponent: PrimInt[src]
type Output = Self
The resulting type after applying the + operator
fn add(self, rhs: F) -> Self::Output
The method for the + operator
impl<F> From<F> for OnlineExactSum<F> where F: Float + Ieee754Ext, F::Significand: PrimInt, F::RawExponent: PrimInt[src]
fn from(x: F) -> Self
Performs the conversion.