bpo-44357:Add math.cbrt() function: Cube Root#26622
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 <dickinsm@gmail.com>
| 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.
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.
But the test for sqrt() does not contain tests for non-integral cases.
There was a problem hiding this comment.
@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.
This is in the wrong "whatsnew" document; this would be a change for Python 3.11, not Python 3.10.
|
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.
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