summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/tool/interpr1.cxx12
-rw-r--r--sc/source/core/tool/interpr2.cxx8
-rw-r--r--solenv/sanitizers/ubsan-suppressions1
3 files changed, 11 insertions, 10 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index bec54db19b56..52db34123cb1 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -1697,7 +1697,7 @@ void ScInterpreter::ScTan()
void ScInterpreter::ScCot()
{
- PushDouble(div(1.0, ::rtl::math::tan(GetDouble())));
+ PushDouble(1.0 / ::rtl::math::tan(GetDouble()));
}
void ScInterpreter::ScArcSin()
@@ -1737,7 +1737,7 @@ void ScInterpreter::ScTanHyp()
void ScInterpreter::ScCotHyp()
{
- PushDouble(div(1.0, tanh(GetDouble())));
+ PushDouble(1.0 / tanh(GetDouble()));
}
void ScInterpreter::ScArcSinHyp()
@@ -1774,22 +1774,22 @@ void ScInterpreter::ScArcCotHyp()
void ScInterpreter::ScCosecant()
{
- PushDouble(div(1.0, ::rtl::math::sin(GetDouble())));
+ PushDouble(1.0 / ::rtl::math::sin(GetDouble()));
}
void ScInterpreter::ScSecant()
{
- PushDouble(div(1.0, ::rtl::math::cos(GetDouble())));
+ PushDouble(1.0 / ::rtl::math::cos(GetDouble()));
}
void ScInterpreter::ScCosecantHyp()
{
- PushDouble(div(1.0, sinh(GetDouble())));
+ PushDouble(1.0 / sinh(GetDouble()));
}
void ScInterpreter::ScSecantHyp()
{
- PushDouble(div(1.0, cosh(GetDouble())));
+ PushDouble(1.0 / cosh(GetDouble()));
}
void ScInterpreter::ScExp()
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 37d84650215a..658119848879 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -1883,11 +1883,11 @@ double ScInterpreter::ScGetRmz(double fRate, double fNper, double fPv,
else
{
if (bPayInAdvance) // payment in advance
- fPayment = div((fFv + fPv * exp( fNper * ::rtl::math::log1p(fRate) ) ) * fRate,
- (::rtl::math::expm1( (fNper + 1) * ::rtl::math::log1p(fRate) ) - fRate));
+ fPayment = (fFv + fPv * exp( fNper * ::rtl::math::log1p(fRate) ) ) * fRate /
+ (::rtl::math::expm1( (fNper + 1) * ::rtl::math::log1p(fRate) ) - fRate);
else // payment in arrear
- fPayment = div((fFv + fPv * exp(fNper * ::rtl::math::log1p(fRate) ) ) * fRate,
- ::rtl::math::expm1( fNper * ::rtl::math::log1p(fRate) ));
+ fPayment = (fFv + fPv * exp(fNper * ::rtl::math::log1p(fRate) ) ) * fRate /
+ ::rtl::math::expm1( fNper * ::rtl::math::log1p(fRate) );
}
return -fPayment;
}
diff --git a/solenv/sanitizers/ubsan-suppressions b/solenv/sanitizers/ubsan-suppressions
index 529f77c1429a..05adbd33ef06 100644
--- a/solenv/sanitizers/ubsan-suppressions
+++ b/solenv/sanitizers/ubsan-suppressions
@@ -13,6 +13,7 @@
# UBSAN_OPTIONS environment variable (and making sure to compile with
# -fsanitize-recover=float-divide-by-zero):
+float-divide-by-zero:sc/source/core/tool/interpr1.cxx
float-divide-by-zero:sc/source/core/tool/interpr2.cxx
float-divide-by-zero:scaddins/source/analysis/analysis.cxx
float-divide-by-zero:scaddins/source/analysis/financial.cxx