<https://pl.kotl.in/urxAUO4rz> :this-is-fine: ```v...
# getting-started
e
https://pl.kotl.in/urxAUO4rz šŸ™‚
Copy code
val a: Double = Double.NaN
println(a == a) // false
val b: Number = a
println(a == b) // true
val c: Double = 0.0
println(c == -c) // true
val d: Number = c
println(d == -c) // false
(yes, I know why this has to happen for IEEE 754 and boxed equals() reasons, it's a fun puzzler to figure out if you don't know why though)
šŸ˜„ 6
a
In Java plugin there is even a ā€œJava | Numeric issues | Floating point equality comparisonā€ inspection, not for Kotlin though.