https://kotlinlang.org logo
#announcements
Title
# announcements
p

ptashcka

04/27/2017, 1:05 PM
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

ilya.gorbunov

04/27/2017, 2:37 PM
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

ptashcka

04/27/2017, 4:53 PM
then I think the bug is with Idea inspections: http://take.ms/Pfhq5
5 Views