SerVB
11/12/2021, 2:26 PMfun eq_double_any(a: Double, b: Any) = a == b
eq_double_any(0.0, -0.0) // should be false but we in Python return true
At the same time:
fun eq_doubleN_double(a: Double?, b: Double) = a == b
eq_doubleN_double(0.0, -0.0) // should be true (and we return true)
mind blownPiotr Krzemiński
11/12/2021, 2:46 PMPiotr Krzemiński
11/12/2021, 2:47 PMSerVB
11/12/2021, 6:17 PMI wonder how it works for such edge cases for e. g. JVM and JS backendI haven't checked but it seems since there is such a test, it passes on official targets. A wild guess would be that boxing can be involved 🤷