Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 98a334b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/core/qgsrect.cpp
Expand Up @@ -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.