File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 21
21
#include < limits>
22
22
#include < QString>
23
23
#include < QTextStream>
24
+ #include < qnumeric.h>
24
25
25
26
#include " qgspoint.h"
26
27
#include " qgsrectangle.h"
@@ -306,18 +307,13 @@ void QgsRectangle::unionRect( const QgsRectangle& r )
306
307
307
308
bool QgsRectangle::isFinite () const
308
309
{
309
- if ( std::numeric_limits< double >::has_infinity )
310
+ if ( qIsInf ( xmin ) || qIsInf ( ymin ) || qIsInf ( xmax ) || qIsInf ( ymax ) )
310
311
{
311
- if ( xmin == std::numeric_limits<double >::infinity () ||
312
- xmax == std::numeric_limits<double >::infinity () ||
313
- ymin == std::numeric_limits<double >::infinity () ||
314
- ymax == std::numeric_limits<double >::infinity () )
315
- return false ;
312
+ return false ;
316
313
}
317
- // By design, if a variable is nan, it won't equal itself, so that's
318
- // how we test for nan
319
- if ( xmin != xmin || xmax != xmax || ymin != ymin || ymax != ymax )
314
+ if ( qIsNaN ( xmin ) || qIsNaN ( ymin ) || qIsNaN ( xmax ) || qIsNaN ( ymax ) )
315
+ {
320
316
return false ;
321
-
317
+ }
322
318
return true ;
323
319
}
You can’t perform that action at this time.
0 commit comments