[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Thu May 19 12:57:28 PDT 2011
sc/source/core/tool/interpr5.cxx | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
New commits:
commit b7a805c683a1143f63fa2bac88a8ae2ae95f6875
Author: Regina Henschel <rb.henschel at t-online.de>
Date: Thu May 19 15:55:13 2011 -0400
fdo#37326: Sign number must be either 1 or -1, never 0.
This fixes incorrect result with LINEST cell function.
Signed-off-by: Kohei Yoshida <kyoshida at novell.com>
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index bc1348c..7f005e2 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -1978,14 +1978,10 @@ double lcl_TGetColumnSumProduct(ScMatrixRef pMatA, SCSIZE nRa,
return fResult;
}
+// no mathematical signum, but used to switch between adding and subtracting
double lcl_GetSign(double fValue)
{
- if (fValue < 0.0)
- return -1.0;
- else if (fValue > 0.0)
- return 1.0;
- else
- return 0.0;
+ return (fValue >= 0.0 ? 1.0 : -1.0 );
}
/* Calculates a QR decomposition with Householder reflection.
More information about the Libreoffice-commits
mailing list