[Libreoffice-commits] core.git: sc/source
Eike Rathke
erack at redhat.com
Mon Feb 13 17:27:07 UTC 2017
sc/source/core/tool/interpr2.cxx | 7 +++----
sc/source/core/tool/interpr3.cxx | 5 ++---
2 files changed, 5 insertions(+), 7 deletions(-)
New commits:
commit 1a1dbff33db8a6f2f55a5d92483a03670a610f6a
Author: Eike Rathke <erack at redhat.com>
Date: Mon Feb 13 18:22:28 2017 +0100
get rid of boost::math::log1p() and use rtl::math::log1p()
... which in turn uses the compiler's std::log1p()
Change-Id: I8878cc31dd4b0c16b04f15822cfbe665e4156109
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 85f2307..0f2f5b1 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -27,7 +27,6 @@
#include <svl/zforlist.hxx>
#include <svl/sharedstringpool.hxx>
#include <sal/macros.h>
-#include <boost/math/special_functions/log1p.hpp>
#include "attrib.hxx"
#include "sc.hrc"
@@ -1855,7 +1854,7 @@ void ScInterpreter::ScPDuration()
double nFuture = GetDouble();
double nPresent = GetDouble();
double nInterest = GetDouble();
- PushDouble(log(nFuture / nPresent) / boost::math::log1p(nInterest));
+ PushDouble(log(nFuture / nPresent) / rtl::math::log1p(nInterest));
}
}
@@ -1972,9 +1971,9 @@ void ScInterpreter::ScNper()
PushDouble(-(nBw + nZw)/nRmz);
else if (bPayInAdvance)
PushDouble(log(-(nInterest*nZw-nRmz*(1.0+nInterest))/(nInterest*nBw+nRmz*(1.0+nInterest)))
- /boost::math::log1p(nInterest));
+ / rtl::math::log1p(nInterest));
else
- PushDouble(log(-(nInterest*nZw-nRmz)/(nInterest*nBw+nRmz))/boost::math::log1p(nInterest));
+ PushDouble(log(-(nInterest*nZw-nRmz)/(nInterest*nBw+nRmz)) / rtl::math::log1p(nInterest));
}
bool ScInterpreter::RateIteration( double fNper, double fPayment, double fPv,
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 033763f..a6ef366 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -34,7 +34,6 @@
#include <math.h>
#include <vector>
#include <algorithm>
-#include <boost/math/special_functions/log1p.hpp>
#include <comphelper/random.hxx>
using ::std::vector;
@@ -588,7 +587,7 @@ double ScInterpreter::GetGamma(double fZ)
if (fZ >= -0.5) // shift to x>=1, might overflow
{
- double fLogTest = lcl_GetLogGammaHelper(fZ+2) - boost::math::log1p(fZ) - log( fabs(fZ));
+ double fLogTest = lcl_GetLogGammaHelper(fZ+2) - rtl::math::log1p(fZ) - log( fabs(fZ));
if (fLogTest >= fLogDblMax)
{
SetError( FormulaError::IllegalFPOperation);
@@ -621,7 +620,7 @@ double ScInterpreter::GetLogGamma(double fZ)
return log(lcl_GetGammaHelper(fZ));
if (fZ >= 0.5)
return log( lcl_GetGammaHelper(fZ+1) / fZ);
- return lcl_GetLogGammaHelper(fZ+2) - boost::math::log1p(fZ) - log(fZ);
+ return lcl_GetLogGammaHelper(fZ+2) - rtl::math::log1p(fZ) - log(fZ);
}
double ScInterpreter::GetFDist(double x, double fF1, double fF2)
More information about the Libreoffice-commits
mailing list