hey! is this the expected behavior? println(Math.s...
# announcements
p
hey! is this the expected behavior? println(Math.sqrt(-1.0) == Double.NaN) // false println(Math.sqrt(-1.0).equals(Double.NaN)) // true
1
i
Yes, this is an expected behavior,
NaN == NaN
are compared as IEEE numbers and that results in false, however
NaN.equals(NaN)
are compared as boxed objects and results in true
Unfortunately, it isn't documented thoroughly yet
p
then I think the bug is with Idea inspections: http://take.ms/Pfhq5