This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new 2b70322d0a calc: some uses for C++11 expm1
2b70322d0a is described below
commit 2b70322d0a1dcef079c5cf96a5496abfc581f5e1
Author: Pedro Giffuni <[email protected]>
AuthorDate: Sun Sep 6 19:10:15 2026 -0500
calc: some uses for C++11 expm1
Just better use of <cmath>
Tested on FreeBSD
---
main/sc/source/core/tool/interpr3.cxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/main/sc/source/core/tool/interpr3.cxx
b/main/sc/source/core/tool/interpr3.cxx
index a1e3f3919e..b327c2f8cb 100644
--- a/main/sc/source/core/tool/interpr3.cxx
+++ b/main/sc/source/core/tool/interpr3.cxx
@@ -1558,7 +1558,7 @@ void ScInterpreter::ScExpDist()
else // Verteilung
{
if (x > 0.0)
- PushDouble(1.0 - exp(-lambda*x));
+ PushDouble(-expm1(-lambda*x));
else
PushInt(0);
}
@@ -1638,7 +1638,7 @@ void ScInterpreter::ScWeibull()
PushDouble(alpha/pow(beta,alpha)*pow(x,alpha-1.0)*
exp(-pow(x/beta,alpha)));
else // Verteilung
- PushDouble(1.0 - exp(-pow(x/beta,alpha)));
+ PushDouble(-expm1(-pow(x/beta,alpha)));
}
}