I\'ve been using isinf, isnan functions on Linux platforms which worked perfectly. But this didn\'t work on OS-X, so I decided to use std::is
isinf
isnan
std::is
isnan is part of C++11 now, included in GCC++ I believe, and Apple LLVM.
Now MSVC++ has an _isnan function in .
Appropriate #defines and #includes should make a suitable workaround.
#define
#include
However, I recommend preventing nan from ever occurring, instead of nan detection.