| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
* Add tests * Add documentation * Add configure-time checks for function presence * Regenerate configure No news item added, pending creation of a github issue. As committed, the local implementation of the functions is always used. For production, the #undefs should be removed so that the presence of the functions is detected by configure and used by mathmodule.
Documentation build overview98 files changed · + 1 added · ± 97 modified + Added ± Modified |
Sorry, something went wrong.
|
|
||
| acospi10000 acospi 0.0 -> 0.5 | ||
| acospi10001 acospi -0.0 -> 0.5 | ||
| acospi10002 acospi 1.0 -> 0.0 |
There was a problem hiding this comment.
Please also test infinite/nan input and values with magnitude > 1. Include appropriate FPE flags, where it's required by the C23 Annex F.
With this, I think you can drop separate tests in the test_math.py for new functions.
Sorry, something went wrong.
There was a problem hiding this comment.
Please add also a What's New entry.
Sorry, something went wrong.
|
|
||
| .. function:: atanpi(x) | ||
|
|
||
| Return the arc tangent of *x*, in half-turns. The result is between ``-1/2`` and |
There was a problem hiding this comment.
Since the result is a float, should not we use 0.5 instead 0f 1/2? The same question for other documentation and examples.
Sorry, something went wrong.
There was a problem hiding this comment.
That's a great question. These doc blocks were made by copypaste of the existing block (e.g., atan) then removing pi.
It's clear why an expression using pi is used in the existing atan2 docs. However, it's possible to ask which would be clearer in the atan2 comment: -.75*pi or -3*pi/4. I feel like the answer to this might make it clear whether -.75 or -3/4 is clearer in the new function's documentation.
Thoughts?
Sorry, something went wrong.
There was a problem hiding this comment.
-3*pi/4 is an expression. I think it is clearer in such way. But for atan2pi we can use exact number: -0.75.
I don't have a firm opinion, I'm just pointing out a possible option. I am fine with any option.
Sorry, something went wrong.
.. as suggested in review
|
Branch updated based on review comments. Thank you for your reviews. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM. 👍
Sorry, something went wrong.
Also use the surrounding style of two spaces after a sentence- ending period.
|
I've updated the PR with additional comment changes as requested. |
Sorry, something went wrong.
| {"atan2", _PyCFunction_CAST(math_atan2), METH_FASTCALL, math_atan2_doc}, | ||
| {"atanh", math_atanh, METH_O, math_atanh_doc}, | ||
| {"atan2pi", _PyCFunction_CAST(math_atan2pi), METH_FASTCALL, math_atan2pi_doc}, | ||
| {"atanpi", math_atanpi, METH_O, math_atanpi_doc}, |
There was a problem hiding this comment.
{"atanpi", math_atanpi, METH_O, math_atanpi_doc},make it aligned with METH_O of atanh
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM, with few remaining comments
Sorry, something went wrong.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
|
Hi. I think I have addressed all open review comments. Is there anything else I can do to help this PR move forward? |
Sorry, something went wrong.
|
Thank you for your contribution @jepler. |
Sorry, something went wrong.
|
Thank you for working with me on this! |
Sorry, something went wrong.
…nGH-150555) Add the the following functions to the math module: acospi, asinpi, atanpi, atan2pi, cospi, sinpi, tanpi.
|
I created PR gh-157858 to rename HAVE_ACOSPI macro to _Py_HAVE_ACOSPI (and rename also similar macros). |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
See #150534 and https://discuss.python.org/t/add-half-turns-functions-cospi-et-al-to-math-module-following-c23-ieee754-2019/107550/5 for discussion and context.
The following functions are added to the math module:
The following aspects of a new feature are covered in this pull request:
The math_testcases.txt cases are based on glibc's test cases, and their input & output values have been used. I supplemented this with tests of inf/nan arguments.
I extended math_testcases.txt so that it can test n-arg functions, and used it to test atan2pi.
Closes: #150534