-
-
Notifications
You must be signed in to change notification settings - Fork 11k
BUG: Integer overflow warning applies to scalars but not arrays #8987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Digging into the mail list from 7 Apr 2009, @rkern writes:
I suspect this is still true, and it's too expensive to check on arrays. I suggest improving the |
This is an exact duplicate of #593. My thoughts were that numpy.seterr was ugly designed. We could make use of some new interface, apart from numpy.seterr, to explicitly define the behavior of integer overflows among choices of
And naming this something like numpy.setintwrap, maybe allow separate settings for scalars and arrays, while replacing numpy.seterr for setfloaterr with no effect on integers. |
To do integer overflow right, you need hardware support. Modern hardware does not provide that support. Some ancient hardware did, but it fell out of favor. |
Eh, you can do it, it just has some penalty in speed. If we added it for arrays then I think we'd also want to have a dedicated option in |
related to issue pandas-dev/pandas#15557 , issue #5657, issue #5166, |
On Windows numpy's default integer type is `numpy.int32`, and not `numpy.int64` like on Mac and Linux. To have the same column types on different platforms and to prevent a known numpy overflow numpy/numpy#8987, `dtype=numpy.int64` was explicitly specified when creating numpy arrays. Since numpy tests don't fail on Windows anymore, adjust AppVeyor config file to install pandas and numpy when building/testing datatable. WIP for #2301
I noticed that numpy.prod overflows silently as well. Not sure if this issue covers that already or if I should open a new issue suggesting an overflow error for that as well. |
If I was not using hypothesis given and the integer strategy to test a function I would have not noticed this issue. sum on an array should trigger an overflow signal. please prioritise! |
Over at #29129 I showed an opt-in path for those who want overflow checking (in this case inside the casting ufuncs used by |
Uh oh!
There was an error while loading. Please reload this page.
Simple demo:
Should we even warn at all for unsigned integers?
The text was updated successfully, but these errors were encountered: