LibreOffice Module sc (master)  1
arraysum.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  */
10 
11 #pragma once
12 
13 #include <math.h>
14 
15 namespace sc::op
16 {
24 inline void sumNeumanierNormal(double& sum, double& err, const double& value)
25 {
26  double t = sum + value;
27  if (fabs(sum) >= fabs(value))
28  err += (sum - t) + value;
29  else
30  err += (value - t) + sum;
31  sum = t;
32 }
33 
34 } // end namespace sc::op
35 
36 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
XPropertyListType t
void sumNeumanierNormal(double &sum, double &err, const double &value)
Performs one step of the Neumanier sum between doubles Overwrites the summand and error sum...
Definition: arraysum.hxx:24