-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-44357:Add math.cbrt() function: Cube Root
#26622
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
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). CLA MissingOur records indicate the following people have not signed the CLA: For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
Co-authored-by: Mark Dickinson <[email protected]>
| self.ftest('cbrt(27)', math.cbrt(27), 3) | ||
| self.ftest('cbrt(-1)', math.cbrt(-1), -1) | ||
| self.ftest('cbrt(-27)', math.cbrt(-27), -3) | ||
| self.assertEqual(math.cbrt(INF), INF) |
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.
Please could you also add some tests for non-integral cases? It would be good to have a check that cbrt(-0.0) returns -0.0 (with the correct sign), too.
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 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.
But the test for sqrt() does not contain tests for non-integral cases.
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.
@serhiy-storchaka That's true, but I'm not sure why you're pointing it out in this PR discussion. Can you clarify? I'd be very happy to review a PR that fixed that defect for math.sqrt, but I think it's off-topic for this PR.
Doc/whatsnew/3.10.rst
Outdated
| When a module does not define ``__loader__``, fall back to ``__spec__.loader``. | ||
| (Contributed by Brett Cannon in :issue:`42133`.) | ||
| math |
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.
This is in the wrong "whatsnew" document; this would be a change for Python 3.11, not Python 3.10.
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.
👍
|
Thank you for the PR! I'll do a proper review later today (UTC+1). |
math.cbrt() function: Cube Root
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.
LGTM. I took the liberty of pushing a commit which tweaks the line spacing a bit, for consistency. Will merge as soon as the checks complete.
Thank you for the contribution!
ty :) |
https://bugs.python.org/issue44357