gh-122637: fix tanh(±0+infj) and tanh(±0+nanj) to return ±0+nanj #122638
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 per C11 DR#471,
ctanh (0 + i NaN)
andctanh (0 + i Inf)
should return0 + i NaN
(with "invalid" exception in the second case). This has corresponding implications forctan(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