Skip to content

cmd/compile: math.Float32frombits and math.Float32bits round-trip mismatch #27193

Closed
@dsnet

Description

@dsnet

Consider the following:

var got, want bool
for i := uint32(0x7f8ddc7e); i <= uint32(0x7f8ddc7e); i++ {
	got = i == math.Float32bits(math.Float32frombits(i))
}
i := uint32(0x7f8ddc7e)
want = i == math.Float32bits(math.Float32frombits(i))
if got != want {
	print("FAIL")
}

I expect this to work fine.
However, this currently prints "FAIL".

Bisect identifies https://go-review.googlesource.com/62250 as the cause.

\cc @cherrymui @mundaym

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions