Skip to content

gh-155966: Correct handling of tanpi(0.5) (#155966) - #155980

Open
jepler wants to merge 9 commits into
python:mainfrom
jepler:issue-155966
Open

gh-155966: Correct handling of tanpi(0.5) (#155966)#155980
jepler wants to merge 9 commits into
python:mainfrom
jepler:issue-155966

Conversation

@jepler

@jepler jepler commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

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_math through 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.

jepler added 3 commits August 17, 2026 17:26
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.
Comment thread Misc/NEWS.d/next/Library/2026-08-17-17-39-41.gh-issue-155966.0YOADY.rst Outdated
Comment thread Lib/test/mathdata/math_testcases.txt Outdated
Comment thread Lib/test/mathdata/math_testcases.txt Outdated
jepler and others added 4 commits August 17, 2026 20:04
…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.
@skirpichev
skirpichev requested a review from picnixz August 18, 2026 01:48
@skirpichev

Copy link
Copy Markdown
Member

CC @picnixz

Comment thread Lib/test/mathdata/math_testcases.txt Outdated
Comment thread Lib/test/mathdata/math_testcases.txt Outdated
@mdickinson

Copy link
Copy Markdown
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants