You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by pf...@apache.org on 2026/09/06 22:55:41 UTC

(openoffice) branch main created (now 399b70361c)

This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/openoffice.git


      at 399b70361c calc: some uses for C++11 expm1

This branch includes the following new commits:

     new 399b70361c calc: some uses for C++11 expm1

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(openoffice) 01/01: calc: some uses for C++11 expm1

Posted by pf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 399b70361c25480720d82695f8ce7ae7c093dfe4
Author: Pedro Giffuni <pf...@apache.org>
AuthorDate: Sun Sep 6 17:54:48 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)));
     }
 }