From 496f5805e99821ff05966a915e006d53bd771de5 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Fri, 9 Nov 2018 17:34:53 +0100 Subject: treat second argument of opencl's dollarde/dollarfr as integer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 3441edd25e2f006db46a6c9f2351558910c6a614) Reviewed-on: https://gerrit.libreoffice.org/64457 --- sc/source/core/opencl/op_financial.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sc/source') 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"; -- cgit