summaryrefslogtreecommitdiff
path: root/sc/source/core/opencl/op_financial.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-10-06 17:48:40 +0200
committerTor Lillqvist <tml@collabora.com>2016-10-06 15:59:20 +0000
commitc13a19d462ef595201447272e357a65f5c005521 (patch)
tree33d1dc319d3e0162a9d8de2532c0afa26e02adfb /sc/source/core/opencl/op_financial.cxx
parent7543399f7278d573f157a48016f407bde3088e15 (diff)
remove approxEqual() from OpenCL
It's only use was approxEqual(value,0.0) which doesn't yield true for any other value than 0.0, so replace with value==0.0 Change-Id: I9f4f496c94c2a24e934a1d33c070a070e4f2e1c6 Reviewed-on: https://gerrit.libreoffice.org/29576 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'sc/source/core/opencl/op_financial.cxx')
-rw-r--r--sc/source/core/opencl/op_financial.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/core/opencl/op_financial.cxx b/sc/source/core/opencl/op_financial.cxx
index 771635510c54..fce903e8e7ab 100644
--- a/sc/source/core/opencl/op_financial.cxx
+++ b/sc/source/core/opencl/op_financial.cxx
@@ -4067,9 +4067,9 @@ void OpTbillprice::GenSlidingWindowFunction(
void RATE::BinInlineFun(std::set<std::string>& decls,
std::set<std::string>& funs)
{
- decls.insert(approxEqualDecl);decls.insert(nKorrValDecl);
+ decls.insert(nKorrValDecl);
decls.insert(SCdEpsilonDecl);decls.insert(RoundDecl);
- funs.insert(approxEqual);funs.insert(Round);
+ funs.insert(Round);
}
void RATE::GenSlidingWindowFunction(
@@ -4127,7 +4127,7 @@ void RATE::GenSlidingWindowFunction(
ss << " {\n";
ss << " fPowNminus1 = pow( 1.0+fX, arg0-1.0);\n";
ss << " fPowN = fPowNminus1 * (1.0+fX);\n";
- ss << " if (approxEqual( fabs(fX), 0.0))\n";
+ ss << " if (fX == 0.0)\n";
ss << " {\n";
ss << " fGeoSeries = arg0;\n";
ss << " fGeoSeriesDerivation = arg0 * (arg0-1.0)";
@@ -4146,7 +4146,7 @@ void RATE::GenSlidingWindowFunction(
ss << " bFound = true;\n";
ss << " else\n";
ss << " {\n";
- ss << " if (approxEqual(fabs(fTermDerivation), 0.0))\n";
+ ss << " if (fTermDerivation == 0.0)\n";
ss << " fXnew = fX + 1.1 * SCdEpsilon;\n";
ss << " else\n";
ss << " fXnew = fX - fTerm ";
@@ -4162,7 +4162,7 @@ void RATE::GenSlidingWindowFunction(
ss << " fX = (arg5 < -1.0) ? -1.0 : arg5;\n";
ss << " while (bValid && !bFound && nCount < nIterationsMax)\n";
ss << " {\n";
- ss << " if (approxEqual(fabs(fX), 0.0)){\n";
+ ss << " if (fX == 0.0){\n";
ss << " fGeoSeries = arg0;\n";
ss << " fGeoSeriesDerivation = arg0 * ";
ss << "(arg0-1.0)* pow(2.0,-1);\n";
@@ -4181,7 +4181,7 @@ void RATE::GenSlidingWindowFunction(
ss << " if (fabs(fTerm) < fEpsilonSmall)\n";
ss << " bFound = true;\n";
ss << " else{\n";
- ss << " if (approxEqual(fabs(fTermDerivation), 0.0))\n";
+ ss << " if (fTermDerivation == 0.0)\n";
ss << " fXnew = fX + 1.1 * SCdEpsilon;\n";
ss << " else\n";
ss << " fXnew = fX - fTerm ";