summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/opencl/op_math.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx
index 341c3b04c333..ec4a75daa9eb 100644
--- a/sc/source/core/opencl/op_math.cxx
+++ b/sc/source/core/opencl/op_math.cxx
@@ -1609,6 +1609,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++)
@@ -1626,12 +1627,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 << "}";