In JLS it is mentioned that :
" x!=x is true if and only if x is NaN,"
and "The equality operator == returns false if either operand is NaN"
But while compiling the below code,it returns just opposite
class val{
int i=7;
public static void main (
String args[]){
Float f = 0.0f/0.0f;
System.out.println(f);
System.out.println(f == f);//output true
System.out.println(f != f);//output false
}
}
Please explain ,