Repository navigation
Add floating-point special cases for floor_divide - #329
Merged
Merged
Conversation
asmeurer
reviewed
Nov 15, 2021
Member
|
These imported into the test suite just fine. I ran the tests and it found that NumPy deviates on those I mentioned. |
Contributor
Author
|
Thanks for reviewing and confirming @asmeurer! |
Contributor
Author
|
The changes introduced in this PR have been reviewed and were discussed at the consortium meeting on 18 November 2021. Will merge, and any subsequent edits can be made in follow-up PRs. @asmeurer @honno You'll want to note that array libraries are allowed to deviate from behavior included in the spec for a subset of the special cases. These special cases are demarcated accordingly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR
floor_divide. The lack of guidance was initially raised in gh-199 (see comment). Upon investigation, NumPy'sfloor_divideis both inconsistent withfloor(divide(x,y))behavior and built-in Python behavior and also diverges from behavior found in other libraries (e.g., TensorFlow). Accordingly, this PR seeks to clarify behavior for floating-point operands and ensure consistency withfloor(divide(x,y))to avoid downstream user surprises. The documented special cases largely follow those ofdivide.