Nice test for NaN
If you are trying to give a NaN or test for NaN, this may help.
IF (some_var /= some_var) THEN
This will return TRUE as a NaN cannot equal itself. This appears to work across windows, Cygwin, and Linux with all common compilers. I do not know about IBM as I do not have access to that compiler. If someone knows of a common built in test, please let me know.