6 std::vector<double> numbers = {0.01, 0.001, 0.0001, 0.000001, 0.00000000001};
8 k.
Add(numbers.begin(), numbers.end());
15 k2.
Add(numbers.begin(), numbers.end());
16 k3.
Add(numbers.begin(), numbers.end());
T Result()
Return the result.
The Kahan compensate summation algorithm significantly reduces the numerical error in the total obtai...
static T Accumulate(const Iterator begin, const Iterator end, const T &initialValue=T{})
Iterate over a datastructure referenced by a pointer and return the result of its accumulation...
void Add(const T &x)
Single element accumulated addition.