summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2018-11-16 17:08:59 +0100
committerLuboš Luňák <l.lunak@collabora.com>2018-12-03 15:29:01 +0100
commit54ea2630358c9881d7efac592155924bd152db71 (patch)
treee5cb20f6d6b3a68b2395f459fa8d4d43b9b31d2c
parent62b0bcfd85eb34ddd96d82c9f96a50588b9c4d80 (diff)
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@collabora.com>
-rw-r--r--sc/source/core/opencl/op_financial.cxx5
1 files changed, 2 insertions, 3 deletions
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 << "}";
}