[Libreoffice-commits] core.git: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Dec 3 14:29:24 UTC 2018


 sc/source/core/opencl/op_financial.cxx |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 54ea2630358c9881d7efac592155924bd152db71
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Fri Nov 16 17:08:59 2018 +0100
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Mon Dec 3 15:29:01 2018 +0100

    fix opencl INTRATE
    
    No idea why somebody thought pow() would be better than a mere division.
    Without this the unittest fails because of a slightly different result.
    
    Change-Id: Ibbde8b872049be310ac98389634aab6eab154ca6
    Reviewed-on: https://gerrit.libreoffice.org/64229
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/sc/source/core/opencl/op_financial.cxx b/sc/source/core/opencl/op_financial.cxx
index 747d8a764343..6b108eeed2d3 100644
--- a/sc/source/core/opencl/op_financial.cxx
+++ b/sc/source/core/opencl/op_financial.cxx
@@ -378,9 +378,8 @@ void OpINTRATE::GenSlidingWindowFunction(std::stringstream& ss,
         }
     }
     ss << "    int nNullDate = GetNullDate();\n";
-    ss << "    tmp = arg3 * pow(arg2,-1) - 1.0;\n";
-    ss << "    tmp = tmp * pow(GetYearDiff_new(nNullDate, (int)arg0,";
-    ss << " (int)arg1,(int)arg4),-1);\n";
+    ss << "    tmp = ((arg3 / arg2) - 1) / GetYearDiff_new(nNullDate, (int)arg0,";
+    ss << "             (int)arg1,(int)arg4);\n";
     ss << "    return tmp;\n";
     ss << "}";
 }


More information about the Libreoffice-commits mailing list