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" <uli.kun...@gmail.com> a écrit : 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 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.