-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
documentation, tests, and bugs in seterr behavior for integer types #3199
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
Conversation
Here's the output of running
|
My gut feeling is that the overflow versus underflow thing isn't worth fixing; instead we should create a new error type "wraparound" that means, integer overflow/underflow. (This has other advantages too -- integer and floating overflow are very different, and the code for manipulating the floating point error flags is stupidly expensive, so it'd be better if the integer operations didn't do it.) I'm pretty sure there's code that's supposed to detect int64 multiply wraparound -- guess it's buggy! |
@ivanov Are you going to pursue this? Otherwise I'm going to close it. |
Wow, blast from the past - had no idea this was still open. I'll see what I can do |
It would really make more sense to add a new error type for integer
|
@ivanov I'm closing this. Let me know if you still want to work on it. |
this is a work in progress. it started off as a documentation improvement for the fact, currently captured in #593 that
np.seterr
does not affect error handling behavior for arrays of integers (although it does mostly work for integer scalars).But in writing a test for this behavior (which I was intending to submit and mark as a KnownFailure), I discovered two other bugs in the scalar handling. These examples assume that
np.seterr(all='raise')
has already been called.