[C/C++] Floating point comparisons with NaN giving inconsistent results

You might notice that when comparing with NaN, the comparison gives wrong results at least for x64 builds. Take a look at the following piece of code. If you run this sample application the comparison statement if(lfv==0.0) returns true and the MessageBox is displayed. (We had a customer who reported this behavior.) #include “stdafx.h” #include […]
Continue reading…