summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/opencl/formulagroupcl.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 7690035c1956..82ef58d81e1c 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -1779,6 +1779,10 @@ public:
ss << ";\n";
}
}
+ if (isAverage())
+ ss <<
+ "if (nCount==0)\n"
+ " return CreateDoubleError(errDivisionByZero);\n";
ss << "return tmp";
if (isAverage())
ss << "*pow((double)nCount,-1.0)";
@@ -2127,7 +2131,7 @@ public:
ss << "fsum_count(" << lhs << "," << rhs << ", &nCount)";
return ss.str();
}
- virtual std::string BinFuncName() const override { return "fsum"; }
+ virtual std::string BinFuncName() const override { return "average"; }
virtual bool isAverage() const override { return true; }
};