Source file test/fixedbugs/issue25322.go

     1  // run
     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  }
    24  

View as plain text