Files
assimp/code/qnan.h
aramis_acg 559daf900d NFF finished except cone implementation.
Added fixes by lynxeye to make assimp work with GCC 4.
Website - again a backup of the current version.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@130 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-09-11 20:50:15 +00:00

33 lines
752 B
C++

#if (!defined AI_QNAN_H_INCLUDED)
#define AI_QNAN_H_INCLUDED
inline bool is_qnan(const float in)
{
// _isnan() takes a double as argument and would
// require a cast. Therefore we must do it on our own ...
// Another method would be to check whether in != in.
// This should also wor since nan compares to inequal,
// even when compared with itself. However, this could
// case problems with other special floats like snan or inf
union _tagFPUNION
{
float f;
int32_t i;
} FPUNION1,FPUNION2;
FPUNION1.f = in;
FPUNION2.f = std::numeric_limits<float>::quiet_NaN();
return FPUNION1.i == FPUNION2.i;
}
inline bool is_not_qnan(const float in)
{
return !is_qnan(in);
}
#endif // !! AI_QNAN_H_INCLUDED