http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60237
--- Comment #2 from N Schaeffer <nathanael.schaeffer at gmail dot com> --- Thank you for your answer. My program (which is a computational fluid dynamics solver) is not supposed to produce NaNs. However, when it does (which means something went wrong), I would like to abort the program and return an error instead of continuing crunching NaNs. I also want it to run as fast as possible (hence the -ffast-math option). I would argue that: if printf("%f",x) outputs "NaN", isnan(x) should also be returning true. Do you have a suggestion concerning my last question: How can I check if x is NaN in a portable way (not presuming any compilation option) ?