github.com/yukk001/go1.10.8@v0.0.0-20190813125351-6df2d3982e20/test/fixedbugs/issue25322.go (about)

     1  // cmpout
     2  
     3  // Copyright 2018 The Go Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  // Missing zero extension when converting a float32
     8  // to a uint64.
     9  
    10  package main
    11  
    12  import (
    13  	"fmt"
    14  	"math"
    15  )
    16  
    17  func Foo(v float32) {
    18  	fmt.Printf("%x\n", uint64(math.Float32bits(v)))
    19  }
    20  
    21  func main() {
    22  	Foo(2.0)
    23  }