Files
assimp/code/qnan.h
aramis_acg 927cd1cd46 Added support for point and line primitives.
Added SortByPType and DeterminePType (anon.) steps
Optimized ASE, fixed 3DS.
Rewrite all loaders to conform to the api changes.
Optimized normal computation code in LWOLoader.cpp
Added new unit tests
Added test file for AC3D (good old wuson again)
 

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@167 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-09-30 20:20:56 +00:00

33 lines
746 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
// cause problems with other special floats like snan
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