Re: [go-nuts] Re: unexpected strconv.FormatFloat behaviour

2017-07-02 Thread Uli Kunitz
You are correct, there is no difference with C printf for these values. -- 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.

Re: [go-nuts] Re: unexpected strconv.FormatFloat behaviour

2017-07-02 Thread Rémy Oudompheng
There is no floating point number which is exactly equal to either 0.05 or 0.15 so in your examples the simple "round to nearest" rule apply (no tie implied). Rémy. Le 2 juil. 2017 9:15 AM, "Uli Kunitz" a écrit : One could justify it, if the rounding rule is "rounding to nearest, ties to even"

[go-nuts] Re: unexpected strconv.FormatFloat behaviour

2017-07-02 Thread Uli Kunitz
One could justify it, if the rounding rule is "rounding to nearest, ties to even". I find other behaviour more strange: -0.5 is rounded to -0 with prec=0 -0.05 is rounded to -0.1 with prec=1 0.15 rounded to 0.1 with prec=1 -- You received this message because you are subscribed to the Google G