gh-155966: Correct handling of tanpi(0.5) (#155966) - #155980
Open
jepler wants to merge 9 commits into
Open
Conversation
As pointed out in the issue, the exceptional half-integer (0.5, 1.5, etc) inputs of tanpi were not handled properly. Now, these raise ValueError and this is tested by `test.test_math` through its list of test cases.
skirpichev
requested changes
Aug 18, 2026
…YOADY.rst Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
the test harness cannot verify the sign of infinity, it can only verify the exception; but it's good for it to be correct anyhow.
This reverts commit faa1799.
skirpichev
approved these changes
Aug 18, 2026
Member
|
CC @picnixz |
mdickinson
reviewed
Aug 18, 2026
skirpichev
reviewed
Aug 18, 2026
Member
|
Mildly off-topic: in case anyone's interested, there's some fun reading here: https://grouper.ieee.org/groups/msc/ANSI_IEEE-Std-754-2019/background/tanpi.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As pointed out in #155966, the exceptional half-integer (0.5, 1.5, etc) inputs of tanpi were not handled properly.
Now, these raise ValueError and this is tested by
test.test_maththrough its list of test cases.In the process of working on this, I noticed that I had incorrectly added duplicate test ids and that this was not treated as an error by the test harness. I have corrected this and made it part of the test.
math.tanpiis untested at its poles and no test-file flag fits #155966