Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
bpo-38639: Optimize floor(), ceil() and trunc() for floats.#16991
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
bpo-38639: Optimize floor(), ceil() and trunc() for floats.#16991
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
mdickinson left a comment
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.
Proposed changes LGTM. For things of exact typefloat (and possibly also forfloat subclasses), I think we could dispense with themath_1_to_int complications to get even more speedup. But that doesn't have to happen in this PR.
Do we have tests for the various cases of floats, float subclasses that don't override__floor__, float subclasses thatdo override__floor__, things that aren't floats but provide a__float__ method, etc.? If not, would it be worth adding such tests?
mdickinson commentedOct 30, 2019
It occurs to me that I don't know how a subclass of |
serhiy-storchaka commentedNov 7, 2019
I think that it would be better to not call |
serhiy-storchaka commentedNov 7, 2019
Thank you for your review@mdickinson, I addressed your comments and added tests. Could you please take another look? |
Uh oh!
There was an error while loading.Please reload this page.
https://bugs.python.org/issue38639