Thanks vf.
The actual piece of code is
class D {
static boolean m(double v) {
return(v != v == Double.isNaN(v)); //line 1
}
public static void main (
String args[]) {
double d1 = Double.NaN;
double d2 = Double.POSITIVE_INFINITY;
double d3 = Double.MAX_VALUE;
System.out.print(m(d1) + "," + m(d2) + "," + m(d3));
}}
'v' is of type double in line 1. I was a bit confused about the precedence of operation. Now I realise that == and != have the same level of precedence and when occuring in the same line , they are evaluated from left to right . Am I right?