Handle isnan at a more central place.

Do not distribute architecture specific
code across a lot of places.
This commit is contained in:
Mathias Froehlich
2012-09-27 18:44:14 +02:00
parent fcd1733787
commit 7bcf02a0b4
4 changed files with 10 additions and 7 deletions
+4 -5
View File
@@ -20,10 +20,6 @@
#include <simgear/constants.h>
#ifndef _MSC_VER
using std::isnan;
#endif
// #define SG_GEOD_NATIVE_DEGREE
/// Class representing a geodetic location
@@ -356,7 +352,10 @@ inline
bool
SGGeod::isValid() const
{
if (isnan(_lon) || isnan(_lat)) return false;
if (SGMiscd::isNaN(_lon))
return false;
if (SGMiscd::isNaN(_lat))
return false;
#ifdef SG_GEOD_NATIVE_DEGREE
return (_lon >= -180.0) && (_lon <= 180.0) &&
(_lat >= -90.0) && (_lat <= 90.0);
-2
View File
@@ -92,7 +92,6 @@ public:
static S lerp(const S& val0, const S& val1, const T& t)
{ return val0*(T(1) - t) + val1*t; }
#ifndef NDEBUG
/// Returns true if v is a NaN value
/// Use with care: allways code that you do not need to use that!
static bool isNaN(const T& v)
@@ -109,7 +108,6 @@ public:
return !(v == v);
#endif
}
#endif
};
#endif