[Libreoffice-commits] core.git: sc/inc

Eike Rathke erack at redhat.com
Thu Aug 13 16:06:50 PDT 2015


 sc/inc/math.hxx |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

New commits:
commit 6eede78d4e75fdbec7e565ebb15f1ce9956734f0
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Aug 14 00:53:33 2015 +0200

    forget about the C++ Standard, use our own known goods
    
    Android-ARM doesn't have std::copysign(), who knows what else will be
    non-functioning on whatever platform..
    
    Change-Id: I40e80c26f2892007caa3729bd0dda2733e875613

diff --git a/sc/inc/math.hxx b/sc/inc/math.hxx
index d97cdf1..2740d76 100644
--- a/sc/inc/math.hxx
+++ b/sc/inc/math.hxx
@@ -49,12 +49,18 @@ inline double div( const double& fNumerator, const double& fDenominator )
  */
 inline double divide( const double& fNumerator, const double& fDenominator )
 {
-    if (fDenominator == 0.0) {
-        if (std::isfinite(fNumerator) && fNumerator != 0.0) {
-            return std::copysign( std::numeric_limits<double>::infinity(), fNumerator);
-        } else {
-            return std::numeric_limits<double>::quiet_NaN();
+    if (fDenominator == 0.0)
+    {
+        double fVal;
+        if (rtl::math::isFinite( fNumerator) && fNumerator != 0.0)
+        {
+            rtl::math::setInf( &fVal, rtl::math::isSignBitSet( fNumerator));
         }
+        else
+        {
+            rtl::math::setNan( &fVal);
+        }
+        return fVal;
     }
     return fNumerator / fDenominator;
 }


More information about the Libreoffice-commits mailing list