Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Implementing numpy.mod for array inputs #1076

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

Merged
merged 7 commits into from
Sep 12, 2022
Merged

Conversation

czgdp1807
Copy link
Collaborator

Closes #1035

@rebcabin
Copy link
Contributor

rebcabin commented Sep 2, 2022

Is numpy.mod defined for negative arguments? If so, are they tested here?

@czgdp1807
Copy link
Collaborator Author

From what I am able to figure out, numpy.mod doesn’t specify anything on sign of integers. Though its numpy.fmod which is supposed to work with negative integers. Plus numpy.mod is re-using Python’s % operator (which numpy.mod is supposed to do), so the behaviour will be equivalent and depend on how we define %.
In any case, I will add a test for negative arrays and arrays with positives, negatives and 0s on Monday.

@czgdp1807 czgdp1807 force-pushed the numpy_mod branch 2 times, most recently from e581faf to 0ef9628 Compare September 3, 2022 06:19
@czgdp1807
Copy link
Collaborator Author

Is numpy.mod defined for negative arguments? If so, are they tested here?

Done.

Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

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

This looks good.

@czgdp1807 czgdp1807 enabled auto-merge September 12, 2022 05:07
@czgdp1807 czgdp1807 merged commit 75cc817 into lcompilers:main Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mod for arrays
3 participants