Make comparison with NaN consistent with javac