Re: [go-nuts] Why do these Printfs output different things?

2017-01-24 Thread Vedran Vekic
Thanks, issue filed. https://github.com/golang/go/issues/18772 On Tuesday, January 24, 2017 at 2:13:15 PM UTC+1, Axel Wagner wrote: > > FWIW, this is the code used for formatting: > https://golang.org/src/strconv/ftoa.go#L54 > I would claim, this difference (and/or its conflict with the >

Re: [go-nuts] Why do these Printfs output different things?

2017-01-24 Thread 'Axel Wagner' via golang-nuts
FWIW, this is the code used for formatting: https://golang.org/src/strconv/ftoa.go#L54 I would claim, this difference (and/or its conflict with the documentation) is a bug. On Tue, Jan 24, 2017 at 2:10 PM, Axel Wagner wrote: > Hm, after some more consideration,

Re: [go-nuts] Why do these Printfs output different things?

2017-01-24 Thread 'Axel Wagner' via golang-nuts
Hm, after some more consideration, this isn't really a good explanation; %g, in conflict with the documentation, behaves differently then *both* %e and %f in this case: https://play.golang.org/p/LEVTU7r4wX On Tue, Jan 24, 2017 at 2:03 PM, Axel Wagner wrote: >

Re: [go-nuts] Why do these Printfs output different things?

2017-01-24 Thread Vedran Vekic
I see. So why does %g produce a different number than %f? On Tuesday, January 24, 2017 at 2:03:58 PM UTC+1, Axel Wagner wrote: > > Because the default-format for floats is %g, not %f: > https://play.golang.org/p/KZBtA3ZVN3 > (documented in the fmt-godoc: https://godoc.org/fmt -- search for >

Re: [go-nuts] Why do these Printfs output different things?

2017-01-24 Thread 'Axel Wagner' via golang-nuts
Because the default-format for floats is %g, not %f: https://play.golang.org/p/KZBtA3ZVN3 (documented in the fmt-godoc: https://godoc.org/fmt -- search for "default format") On Tue, Jan 24, 2017 at 2:00 PM, Vedran Vekic wrote: > https://play.golang.org/p/-gSNqKZlst > >

[go-nuts] Why do these Printfs output different things?

2017-01-24 Thread Vedran Vekic
https://play.golang.org/p/-gSNqKZlst -- 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. For more options, visit