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

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
üst 1e7f551b
......@@ -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;
}
......
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