-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.release-blocker
Milestone
Description
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go version go1.10.2 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
happens on GOOS="linux"
What did you do?
the high 32 bits of uint64(math.Float32bits(x)) are not zero
If possible, provide a recipe for reproducing the error.
package main
import (
"fmt"
"math"
)
func Foo(v float32) {
fmt.Printf("%x\n", uint64(math.Float32bits(v)))
}
func main() {
Foo(2.0)
}this produces "c440000000"
What did you expect to see?
40000000
What did you see instead?
c40000000
The high order bits are not cleared in the cast to uint64
works fine in 1.9.6 and the generated code in 1.10.2 seems to optimize the cast out.
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.release-blocker