uint64 and int64 comparisons are now exact

May 7, 2023
3:41 a.m.
Hi all, Just in case anyone has an opinion. We just merged: https://github.com/numpy/numpy/pull/23713/files That PR makes comparisons like `uint64(2**62) == int64(2**62+1)` exact. It may seem confusing, why it isn't before. The reason is that NumPy promotes `uint64` and `int64` to `float64` which loses precision. That promotion is odd; the PR changes it only in the context of comparisons by making sure we don't promote and adding a specific `uint64` and `int64` comparison (which also solves `uint64` and `int8`). Comparisons are probably special enough, since there is no opportunity to see the intermediate float. (There should be a larger opportunity for optimizing the comparison.) Cheers, Sebastian
677
Age (days ago)
677
Last active (days ago)
0 comments
1 participants
participants (1)
-
Sebastian Berg