Kaydet (Commit) e2d31d96 authored tarafından Eike Rathke's avatar Eike Rathke

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
üst f04257d8
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment