Skip to content

math: pure go version of math.Sqrt is broken #13013

@ghost

Description

If you pass math.Float64frombits(uint64(2)) to math.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#L110

Unfortunatelly 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions