sc/source/core/opencl/op_math.cxx | 5 +++++ 1 file changed, 5 insertions(+)
New commits: commit 79ed7bbacae43468b690a3d3a6b1acf31e641cee Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Tue Dec 4 12:44:40 2018 +0100 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Wed Dec 5 10:59:59 2018 +0100 fix OpenCL ROUND() when the second parameter is negative Change-Id: Ibbf374f72e83609a602504d9ffde922896338c2c Reviewed-on: https://gerrit.libreoffice.org/64543 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lu...@collabora.com> diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx index a9216f72b3e7..224c6480c3b5 100644 --- a/sc/source/core/opencl/op_math.cxx +++ b/sc/source/core/opencl/op_math.cxx @@ -1610,6 +1610,7 @@ void OpLn::GenSlidingWindowFunction( void OpRound::GenSlidingWindowFunction(std::stringstream &ss, const std::string &sSymName, SubArguments &vSubArguments) { + CHECK_PARAMETER_COUNT( 1, 2 ); ss << "\ndouble " << sSymName; ss << "_"<< BinFuncName() <<"("; for (size_t i = 0; i < vSubArguments.size(); i++) @@ -1627,12 +1628,16 @@ void OpRound::GenSlidingWindowFunction(std::stringstream &ss, { ss << " for(int i=0;i<tmp1;i++)\n"; ss << " tmp0 = tmp0 * 10;\n"; + ss << " for(int i=0;i>tmp1;i--)\n"; + ss << " tmp0 = tmp0 / 10;\n"; } ss << " double tmp=round(tmp0);\n"; if(vSubArguments.size() ==2) { ss << " for(int i=0;i<tmp1;i++)\n"; ss << " tmp = tmp / 10;\n"; + ss << " for(int i=0;i>tmp1;i--)\n"; + ss << " tmp = tmp * 10;\n"; } ss << " return tmp;\n"; ss << "}"; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits