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 <axel.wagner...@googlemail.com>
wrote:

> 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 <
> axel.wagner...@googlemail.com> 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
>> "default format")
>>
>> On Tue, Jan 24, 2017 at 2:00 PM, Vedran Vekic <vedran.ve...@gmail.com>
>> wrote:
>>
>>> 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 https://groups.google.com/d/optout.
>>>
>>
>>
>

-- 
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 https://groups.google.com/d/optout.

Reply via email to