I'm getting a lot of headache with a simple isnan
test in my code. I have a 3d vector class with variables x
,y
,z
of type double
, and the following function in the header file:
#ifdef WIN32
bool IsValid() const {return !_isnan(x) && _finite(x) && !_isnan(y) && _finite(y) && !_isnan(z) && _finite(z);} //is a valid vector? (funky windows _ versions...)
#else
bool IsValid() const {return !isnan(x) && finite(x) && !isnan(y) && finite(y) && !isnan(z) && finite(z);} //is a valid vector?
#endif
I'm building in a Linux GCC environment on Eclipse CDT and getting the following error:
Function '__isnanl' could not be resolved
as well as
Function '__isnanf' could not be resolved
for all instances of isnan
. Using std::isnan
and including float.h
and math.h
don't solve it. Does anyone know what's going on?