I'm encountering different overflow behavior on Mac vs Linux with the same version of numpy. MWE:
import numpy as np
arr = np.arange(0, 2 * 4e9, 1e9, dtype=float)
print(arr.astype(np.uint32))
print(np.__version__)
Mac (Python 3.9.13):
array([ 0, 1000000000, 2000000000, 3000000000, 4000000000,
705032704, 1705032704, 2705032704], dtype=uint32)
'1.22.4'
Linux (Python 3.9.7):
array([ 0, 1000000000, 2000000000, 3000000000, 4000000000,
0, 0, 0], dtype=uint32)
'1.22.4'
I would prefer the "Mac" behavior of the expected rollover (rather than forcing overflowed values to 0), so I would like to know how to fix this for the Linux version.