[Libreoffice-commits] .: Branch 'libreoffice-3-4-0' - sc/source

Michael Meeks michael at kemper.freedesktop.org
Fri May 20 01:35:51 PDT 2011


 sc/source/core/tool/interpr5.cxx |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 6529fa0a498cdc189054f3f7bcd319c1e40d1f06
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