Double.NaN == Double.NaN is false
This code segment:
if (Double.NaN == Double.NaN) {
System.out.print("True");
}
else {
System.out.println("False");
}
will print "False".
But IntelliJ warns about the expression being always true:
"Condition Double.NaN == Double.NaN is always true."
This is wrong.
请先登录再写评论。
What's the use of this code ?
BoD
Amir Eliaz wrote:
See
http://www.intellij.net/tracker/idea/viewSCR?publicId=15216
It's from a test I am giving to students :)
Right, it's a duplicate...
Mine was in first ;)