summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2018-11-09 17:34:53 +0100
committerLuboš Luňák <l.lunak@collabora.com>2018-12-04 17:43:24 +0100
commit496f5805e99821ff05966a915e006d53bd771de5 (patch)
tree4ee0025f9dd1702369defc0e2be0cdbbb0617134 /sc/source
parent355ff6333b3129dc4df9d5bc0e78b36b99a73686 (diff)
treat second argument of opencl's dollarde/dollarfr as integer
That's how the scaddins implementation works, and the unittests fail in opencl mode without this. Change-Id: I08ea7dd0a0222408abf899d2da649be53f314a4c Reviewed-on: https://gerrit.libreoffice.org/64227 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com> (cherry picked from commit 3441edd25e2f006db46a6c9f2351558910c6a614) Reviewed-on: https://gerrit.libreoffice.org/64457
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/opencl/op_financial.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/core/opencl/op_financial.cxx b/sc/source/core/opencl/op_financial.cxx
index 7504cad66617..747d8a764343 100644
--- a/sc/source/core/opencl/op_financial.cxx
+++ b/sc/source/core/opencl/op_financial.cxx
@@ -185,9 +185,9 @@ void OpDollarde::GenSlidingWindowFunction(
ss << vSubArguments[1]->GenSlidingWindowDeclRef();
ss<<"))\n\t\t";
ss<<"fFrac = 0;\n\telse \n\t\t";
- ss<<"fFrac = ";
+ ss<<"fFrac = (int)(";
ss << vSubArguments[1]->GenSlidingWindowDeclRef();
- ss<<";\n\t";
+ ss<<");\n\t";
ss << "tmp = modf( dollar , &fInt );\n\t";
ss << "tmp /= fFrac;\n\t";
ss << "tmp *= pow( 10.0 , ceil( log10(fFrac ) ) );\n\t";
@@ -236,9 +236,9 @@ void OpDollarfr::GenSlidingWindowFunction(std::stringstream &ss,
ss << vSubArguments[1]->GenSlidingWindowDeclRef();
ss<<"))\n\t\t";
ss<<"fFrac = 0;\n\telse \n\t\t";
- ss<<"fFrac = ";
+ ss<<"fFrac = (int)(";
ss << vSubArguments[1]->GenSlidingWindowDeclRef();
- ss<<";\n\t";
+ ss<<");\n\t";
ss << "tmp = modf( dollar , &fInt );\n\t";
ss << "tmp *= fFrac;\n\t";
ss << "tmp *= pow( 10.0 , -ceil( log10(fFrac ) ) );\n\t";