![](https://secure.gravatar.com/avatar/214fe9a0ecb4aed8994e8618ade6f5a8.jpg?s=120&d=mm&r=g)
Peter Moulder wrote:
isnan unfortunately isn't part of the C++ standard.
Availability of isnan, std::isnan, _isnan and friends can vary according to whether <math.h> has been #included (perhaps indirectly such as by C-based libraries that we use) and whether <cmath> has been #included (perhaps indirectly such as by standard C++ headers that we #include).
We may need to write our own isnan.h header.
Does anyone know whether `x != x' is a portable definition of isnan?
(`(libc)FP Comparison Functions' says that `!=' doesn't raise an exception for NaN in IEEE arithmetic, btw.)
pjrm.
You might look at the macros that are in math.h or cmath or wherever they are. That might be the proper way.
But..... it is possible that this needs to be another test in configure.in.
Or... if this is a switch in config.h.in, then we can have Unices do it via ./configure, and have it hardcoded for Win32.
There seem to be three ways that work on various versions of gcc:
1: Use math.h and call isnan(). 2: Use math.h and call std::isnan() 3: Use <cmath> and call std::isnan()
Bob