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

Eike Rathke erack at redhat.com
Thu Aug 13 14:38:28 PDT 2015


 sc/inc/math.hxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e2d31d96f645619b534465c548962b07848a55e4
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Aug 13 23:30:55 2015 +0200

    do not use INFINITY (or NAN while at it..) macro
    
    With MSVC werror bails out, that generates
    warning C4756: overflow in constant arithmetic
    because aparently there is
    
     #define _HUGE_ENUF  1e+300  /* _HUGE_ENUF*_HUGE_ENUF must overflow */
     #define INFINITY   ((float)(_HUGE_ENUF * _HUGE_ENUF))  /* causes warning
                         C4756: overflow in constant arithmetic (by design) */
    
    Great stuff..
    
    Change-Id: Id85e3cac6ea24858654ced617c7e06c62f78374d

diff --git a/sc/inc/math.hxx b/sc/inc/math.hxx
index 46f9a1d..d97cdf1 100644
--- a/sc/inc/math.hxx
+++ b/sc/inc/math.hxx
@@ -51,9 +51,9 @@ inline double divide( const double& fNumerator, const double& fDenominator )
 {
     if (fDenominator == 0.0) {
         if (std::isfinite(fNumerator) && fNumerator != 0.0) {
-            return std::copysign(INFINITY, fNumerator);
+            return std::copysign( std::numeric_limits<double>::infinity(), fNumerator);
         } else {
-            return NAN;
+            return std::numeric_limits<double>::quiet_NaN();
         }
     }
     return fNumerator / fDenominator;


More information about the Libreoffice-commits mailing list