Skip to content
Permalink
Browse files
Make the check for nan actually work
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6000 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Oct 23, 2006
1 parent c7950bc commit 98a334be94c3d193e2a1904a2087f5fa78c2a7c2
Showing with 5 additions and 10 deletions.
  1. +5 −10 src/core/qgsrect.cpp
@@ -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;
}

0 comments on commit 98a334b

Please sign in to comment.