-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
DOC: Warn about the difference between np.remainder and math.remainder #9702
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
* Python 3.7's `math.remainder` and C's ``remainder``, which | ||
computes the IEEE remainder, which are the complement to | ||
``round(x1 / x2)``. | ||
* Matlab's ``rem``, which is the complement to ``int(x1 / x2)``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need the (TM) appendix? Just curious because the original version had one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was accidental - but doing a search seems to reveal that we don't use a TM sign anywhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other places, but all in the ufunc documentation. It looks like we don't need it for the function documentation, https://www.mathworks.com/brandguide/editorial/products.html, but we might want to put a copyright and trademark notice somewhere in the documentation, I don't know where.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the mathworks style guide wants it in caps and without the possessive suffix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've switched to all caps
Python 3.7 adds its own `math.remainder` with different semantics to ours. We can't change the semantics now, but we can warn users that they are different.
c27e0db
to
429f99e
Compare
Thanks Eric. |
Is there a reason that we didn't just name this function As an aside, should we add an |
The |
The IEEE remainder might have an interesting interaction with the rounding mode, but should have good precision on both sides of zero for NumPy round to even, unlike floor remainder. |
Python 3.7 adds its own
math.remainder
with different semantics to ours.We can't change the semantics now, but we can warn users that they are different.