diff options
author | Eike Rathke <erack@redhat.com> | 2015-08-13 23:30:55 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-08-13 23:36:56 +0200 |
commit | e2d31d96f645619b534465c548962b07848a55e4 (patch) | |
tree | b66dacedd1558ac60e94c7a29830df1712bddf30 /sc/inc/math.hxx | |
parent | blind fix MSVC werror C4701,C4703 potentially uninitialized local variable (diff) | |
download | core-e2d31d96f645619b534465c548962b07848a55e4.tar.gz core-e2d31d96f645619b534465c548962b07848a55e4.zip |
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
Diffstat (limited to 'sc/inc/math.hxx')
-rw-r--r-- | sc/inc/math.hxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/inc/math.hxx b/sc/inc/math.hxx index 46f9a1d30fca..d97cdf14dae3 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; |