Wow, just found an interesting test (IrPythonCodeg...
# python-contributors
s
Wow, just found an interesting test (IrPythonCodegenBoxTestGenerated$BinaryOp.testEqNullableDoubles):
Copy code
fun 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:
Copy code
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 blown
p
I wonder how it works for such edge cases for e. g. JVM and JS backend, if there are differences. 2 years ago I caught one difference when it comes to behavior of floating point numbers
To be frank, I'd shelve such issues for later, unless they are blockers for something more important :D
1
s
I wonder how it works for such edge cases for e. g. JVM and JS backend
I 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 🤷