This is a known problem: https://github.com/golang/go/issues/34993
It was fixed in Go 1.14: 
https://go-review.googlesource.com/c/tools/+/202041/

I'm curious what you use hex float for?

On Tuesday, March 3, 2020 at 7:10:00 PM UTC-5, bup...@gmail.com wrote:

> Playground: https://play.golang.org/p/2j2PlKwiA7B
>
> Source code:
>
> package main
>    
> import (
>  "fmt"
> )
>    
> func main() {
>  fmt.Printf("%x\n", 5.0/7.0)
> }
>
>
> Expected: No message emits by go vet
>
>
> Actual: go vet emits the following message:
>
> ./prog.go:8:2: Printf format %x has arg 5.0 / 7.0 of wrong type float64 
>
>
> According to https://golang.org/pkg/fmt/ , %x with floating point 
> displays hexadecimal notation (with decimal power of two exponent), which 
> is legal usage. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/23f5469a-07c3-4331-9ab7-36c0f05050a0%40googlegroups.com.

Reply via email to