Make the check for nan actually work

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6000 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
g_j_m 2006-10-23 08:46:55 +00:00
parent c7950bcd5b
commit 98a334be94

View File

@ -292,15 +292,10 @@ bool QgsRect::isFinite() const
ymax == std::numeric_limits<double>::infinity())
return false;
}
// Only check for quiet NaN, as the signalling NaN will have caused
// an exception well before we get the chance to get here.
if (std::numeric_limits<double>::has_quiet_NaN)
{
if (xmin == std::numeric_limits<double>::quiet_NaN() ||
xmax == std::numeric_limits<double>::quiet_NaN() ||
ymin == std::numeric_limits<double>::quiet_NaN() ||
ymax == std::numeric_limits<double>::quiet_NaN())
return false;
}
// By design, if a variable is nan, it won't equal itself, so that's
// how we test for nan
if (xmin != xmin || xmax != xmax || ymin != ymin || ymax != ymax)
return false;
return true;
}