-
Notifications
You must be signed in to change notification settings - Fork 18k
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
math: pure go version of math.Sqrt is broken #13013
Labels
Milestone
Comments
Nice find, any subnormal with 0 LSB will hit this. Fixed in https://golang.org/cl/16158. |
CL https://golang.org/cl/16158 mentions this issue. |
Should this fix also be applied to src/runtime/sqrt.go#L120 ? https://github.com/golang/go/blob/master/src/runtime/sqrt.go#L120 |
@binarycrusader yeah, I'll submit another CL |
CL https://golang.org/cl/16291 mentions this issue. |
minux
pushed a commit
that referenced
this issue
Oct 23, 2015
This copies the change from CL 16158 (applied as 22d4c8b). Updates #13013 Change-Id: Id7d02e63d92806f06a4e064a91b2fb6574fe385f Reviewed-on: https://go-review.googlesource.com/16291 Reviewed-by: Minux Ma <minux@golang.org> Run-TryBot: Minux Ma <minux@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If you pass
math.Float64frombits(uint64(2))
tomath.Sqrt
on a machine that uses the software version (such as ppc64x https://golang.org/src/math/stubs_ppc64x.s#L87) it will end up in an infinite loop here https://golang.org/src/math/sqrt.go#L110Unfortunatelly i don't have a ppc64x machine nearby. So I can't test this properly, however I did copy the library and manually call
math.sqrt
(the unexported, pure go version) with the argument and I have reproduced the problem.The text was updated successfully, but these errors were encountered: