-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmath.tanh(±0+infj) and tanh(±0+nanj) should return ±0+nanj #122637
Labels
type-bug
An unexpected behavior, bug, or error
Comments
skirpichev
added a commit
to skirpichev/cpython
that referenced
this issue
Aug 3, 2024
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
mdickinson
pushed a commit
that referenced
this issue
Aug 4, 2024
…2638) 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
Closed in #122638, with thanks to @skirpichev. As with #121889, I don't think this is behaviour that should be changed in a bugfix release, so it's not a candidate for backport. |
Great. Now glibc's libm pass cmath_testcases.txt. One minor note, now we have slightly misleading comment: Lines 157 to 158 in e6fad7a
This (and fix for #121889) is available in C17, not Probably, we should adjust comment. PS: And now this really closed. |
brandtbucher
pushed a commit
to brandtbucher/cpython
that referenced
this issue
Aug 7, 2024
python#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
blhsing
pushed a commit
to blhsing/cpython
that referenced
this issue
Aug 22, 2024
python#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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Bug description:
As per C11 DR#471 (accepted for C17),
ctanh (0 + i NaN)
andctanh (0 + i Inf)
should return0 + i NaN
(with "invalid" exception in the second case). Currently, real part is nan.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)
.See glibc patch: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=d15e83c5f5231d971472b5ffc9219d54056ca0f1
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: