-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
gollvm/gofrontend: complex division produces wrong results. #52808
Comments
The Go spec doesn't claim to follow ISO/IEC 9899:1999, so this may not be a bug. |
cc @thanm |
I'll take a look. |
gccgo also prints |
Currently, there is a running error in gonum testing. (https://github.com/gonum/gonum/tree/master/lapack/gonum) |
How about moving the implementation of |
That would be once way to do it. |
As a historical note libgo used to have its own implementation of complex division (https://go.googlesource.com/gofrontend/+/6b01f8cdc11d86bd98165c91d6ae101bcf6b9e1a/libgo/runtime/go-cdiv.c). I removed it because because at least with gccgo it was no longer needed. But it didn't quite match the discussion on #14644, and removing it did match where that discussion wound up with the gc compiler. So I removed it (https://go.dev/cl/274213). (I'm a bit surprised that GoLLVM doesn't just do what C99 expects by default.) |
What version of Go are you using (
go version
)?gollvm
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputIntel(R) Xeon(R) Platinum 8260 CPU @ 2.40GHz (Cascade Lake)
What did you do?
error case:
What did you expect to see?
(0+0i)
According to ISO/IEC 9899:1999 (E), (0+0i) / (NaN+Infi) = (0+0i)
What did you see instead?
(NaN+NaNi)
The text was updated successfully, but these errors were encountered: