Skip to content

math: Ldexp doesn't handle denormals correctly #23407

Closed
@crvv

Description

@crvv

What version of Go are you using (go version)?

1.9.2 and tip

Does this issue reproduce with the latest release?

Yes

What did you do?

https://play.golang.org/p/3OfmZgFcjRR

What did you expect to see?

math.Ldexp(1, -1075) = 0
math.Ldexp(1.000000000000001, -1075) = 5e-324
math.Ldexp(2, -1075) = 5e-324

What did you see instead?

math.Ldexp(1, -1075) = 0
math.Ldexp(1.000000000000001, -1075) = 0
math.Ldexp(2, -1075) = 5e-324

The result of ldexp_386.s is correct.
This issue is that the function ldexp written in Go doesn't handle denormals correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions