14#ifndef OR_TOOLS_BASE_ACCURATE_SUM_H_
15#define OR_TOOLS_BASE_ACCURATE_SUM_H_
22template <
typename FpNumber>
31 const FpNumber new_sum = sum_ + error_sum_;
32 error_sum_ += sum_ - new_sum;
37 FpNumber
Value()
const {
return sum_; }
void Add(const FpNumber &value)
Adds an FpNumber to the sum.
FpNumber Value() const
Gets the value of the sum.
AccurateSum()
You may copy-construct an AccurateSum.
In SWIG mode, we don't want anything besides these top-level includes.