PLaSK library
|
Allow to compute sum of doubles much more accurate than directly. More...
#include <plask/math.hpp>
Public Member Functions | |
AccurateSum (double initial=0.0) | |
AccurateSum & | operator= (double v) |
AccurateSum (const AccurateSum &initial)=default | |
AccurateSum & | operator= (const AccurateSum &v)=default |
AccurateSum & | operator+= (double v) |
AccurateSum & | operator-= (double v) |
operator double () const | |
AccurateSum & | operator+= (const AccurateSum &other) |
Allow to compute sum of doubles much more accurate than directly.
It uses O(1) memory (stores 2 doubles) and all it's operation has O(1) time complexity.
It uses Kahan method http://en.wikipedia.org/wiki/Kahan_summation_algorithm
|
inline |
|
default |
AccurateSum & plask::AccurateSum::operator+= | ( | const AccurateSum & | other | ) |
AccurateSum & plask::AccurateSum::operator+= | ( | double | v | ) |
|
inline |
|
default |
AccurateSum & plask::AccurateSum::operator= | ( | double | v | ) |