-
Notifications
You must be signed in to change notification settings - Fork 18k
math/cmplx: hyperbolic sinh, cosh and tanh give wrong result for Inf input #29320
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
Comments
I would recommend conforming to the C99 Standard Appendix G.6 for complex arithmetic which differs slightly from the expected results above.
Likely other special cases may not be handled consistent with the C99 standard either. |
Yes, those seem most reasonable. Note that |
See also So, yes. Others are not consistent with C99 either. |
CC @griesemer |
Also |
Change https://golang.org/cl/169501 mentions this issue: |
Change https://golang.org/cl/206037 mentions this issue: |
This reverts CL 169501. Reason for revert: The new tests fail at least on s390x and MIPS. This is likely a minor bug in the compiler or runtime. But this point in the release cycle is not the time to debug these details, which are unlikely to be new. Let's try again for 1.15. Updates #29320 Fixes #35443 Change-Id: I2218b2083f8974b57d528e3742524393fc72b355 Reviewed-on: https://go-review.googlesource.com/c/go/+/206037 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
As @ianlancetaylor wrote on the revert:
|
Change https://golang.org/cl/220689 mentions this issue: |
Implement special case handling and testing to ensure conformance with the C99 standard annex G.6 Complex arithmetic. Fixes golang#29320 Change-Id: Id72eb4c5a35d5a54b4b8690d2f7176ab11028f1b Reviewed-on: https://go-review.googlesource.com/c/go/+/220689 Reviewed-by: Robert Griesemer <gri@golang.org>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Run the code at https://play.golang.org/p/8dz30xSTLdI.
Notice that sinh(inf) and cosh(inf) are inf, and tanh(inf) is 1.
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: