]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-122637: fix tanh(±0+infj) and tanh(±0+nanj) to return ±0+nanj (#122638)
authorSergey B Kirpichev <skirpichev@gmail.com>
Sun, 4 Aug 2024 09:05:30 +0000 (12:05 +0300)
committerGitHub <noreply@github.com>
Sun, 4 Aug 2024 09:05:30 +0000 (10:05 +0100)
commite6fad7a0e3d824f4a3c9cd71a48208880606d705
tree22436cb9d5b55cfbe0a8209cc63e7bdc363ca608
parent3462a80d2cf37a63fe43f46f64a8c9823f84531d
gh-122637: fix tanh(±0+infj) and tanh(±0+nanj) to return ±0+nanj (#122638)

As per C11 DR#471, ctanh (0 + i NaN) and ctanh (0 + i Inf) should return
0 + i NaN (with "invalid" exception in the second case).  This has
corresponding implications for ctan(z), as its errors and special cases
are handled as if the operation is implemented by -i*ctanh(i*z).
This patch fixes cmath's code to do same.

Glibs patch: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=d15e83c5f5231d971472b5ffc9219d54056ca0f1
Lib/test/mathdata/cmath_testcases.txt
Misc/NEWS.d/next/Library/2024-08-03-06-51-08.gh-issue-122637.gpas8J.rst [new file with mode: 0644]
Modules/cmathmodule.c