Skip to content

Commit

Permalink
Main: Math - assert that isNaN is potentially working
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Oct 4, 2022
1 parent 753d20d commit e4c82fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion OgreMain/include/OgreMath.h
Expand Up @@ -319,7 +319,10 @@ namespace Ogre
static inline Real Ceil (Real fValue) { return std::ceil(fValue); }
static inline bool isNaN(Real f)
{
// std::isnan() is C99, not supported by all compilers
#if defined(__FAST_MATH__) || defined(_M_FP_FAST)
assert(false && "not available with fast math");
#endif
// std::isnan() has non-portable behaviour on MSVC
// However NaN always fails this next test, no other number does.
return f != f;
}
Expand Down

0 comments on commit e4c82fe

Please sign in to comment.