GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — bpo-38629: implement __floor__ and __ceil__ for float by isidentical · Pull Request #16985 · python/cpython Conversation
|
|
This PR needs tests. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR. Some changes are needed:
libm functions ceil and floor.ceil and floor into PyLong_FromDouble.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
e4ff4b8 to
0b36750
Compare
|
I have made the requested changes; please review again |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for making the requested changes! @mdickinson: please review the changes made to this pull request. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I submitted benchmarks to bpo |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM; thank you! The performance is still a concern, but if some form of #16991 gets merged then that wouldn't be so much of an issue.
@serhiy-storchaka @vstinner Does the current state of the PR seem okay to you?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
#16991 will solve the performance issue for exact floats, but not for subclasses. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I don't think there's too much reason to care about fine-tuning of performance for |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
b2bd4eb to
40db4db
Compare
|
me:
I checked the current implementation of math.floor(): there is a fast-path for exact type float which does something like I'm fine with calling the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Oh, that's @serhiy-storchaka 's PR #16991 which has just been merged. I didn't notice ;-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM. There is no performance overhead on math.floor() and math.ceil() for exact float.
I'm fine with having a small overhead for float subclasses. I didn't measure the overhead, I expect it to be really small or even not significant.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@mdickinson @serhiy-storchaka: I'm not sure that you agree, so I didn't merge the PR. I approve the PR, so I'm fine with merging it. What about you? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@mdickinson @serhiy-storchaka: I plan to merge this PR next Friday (December 21) if no one replies. @isidentical: Please ping me next Friday if I forget to merge your PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@vstinner Merging is fine with me. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.