Why Float.NaN == Float.NaN
gives false
? I have tested it on more than one JVMs.
Any help is appreciated .
System.out.println(Float.NaN == Float.NaN); // gives false
Why Float.NaN == Float.NaN
gives false
? I have tested it on more than one JVMs.
Any help is appreciated .
System.out.println(Float.NaN == Float.NaN); // gives false
That's not specific to Java.
IEEE754's NaN are by contract equal to no number, even themselves.