Content originally posted in LPCWare by stalisman on Tue Oct 15 03:35:35 MST 2013
could try this for now:
One noteworthy property of NaNs is that they are not equal to themselves. Thus, x == x can be 0 if the value of x is a NaN. You can use this to test whether a value is a NaN or not: if it is not equal to itself, then it is a NaN.