Skip to content
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

ENH: add overflow handling for scalar negative operation #21790

Merged
merged 5 commits into from Jun 18, 2022

Conversation

Micky774
Copy link
Contributor

Related Issues/PRs
Follow-up to #21648

Changes
Adds check to scalar negative for determining whether an overflow warning should be raised for signed integers. Improves testing for negative operator on unsigned integers.

Comments
N/A

Copy link
Member

@seberg seberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks. Comment is just a thought, so may just merge later today in either case.

numpy/core/src/umath/scalarmath.c.src Outdated Show resolved Hide resolved
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
@ganesh-k13
Copy link
Member

ganesh-k13 commented Jun 18, 2022

We are making various changes which I'm guessing will be flagged by some downstream package anytime soon. Should we release note all this somewhere? I can take it up as a separate PR to capture all this if needed.
[EDIT] We can track it by tagging to #21506 (need to rephrase the issue)?

@seberg
Copy link
Member

seberg commented Jun 18, 2022

Thanks @Micky774, lets put this in. Yeah, good point @ganesh-k13. I think downstream already noticed, although it gets drowned a bit by the cast changes.
A PR that summarizes all of these scalar math (or maybe scalar math + division) changes would be great!

@seberg seberg merged commit d592523 into numpy:main Jun 18, 2022
@ganesh-k13
Copy link
Member

Cool! I'll start work on it. For future reference, please tag all similar changes related to overflow to #21506

@Micky774 Micky774 deleted the int_overflow_tests branch June 18, 2022 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants