Rémi Lapeyre added the comment:
This is called banker rounding and is done on purpose to limit the accumulation
of errors when summing a list of rounded integers. You can read
https://en.m.wikipedia.org/wiki/Rounding#Round_half_to_even and look at IEEE
754 for more information.
--
no
SilentGhost added the comment:
This is the documented behaviour. It might seem counter-intuitive, but it's is
not likely to change.
--
nosy: +SilentGhost
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
Karthikeyan Singaravelan added the comment:
https://docs.python.org/3/whatsnew/3.0.html
> The round() function rounding strategy and return type have changed. Exact
> halfway cases are now rounded to the nearest even result instead of away from
> zero. (For example, round(2.5) now returns 2
New submission from Juho Pesonen :
As the title says I have got some wrong outputs with the round() built-in
function.
The bug occurs only with certain numbers though. (I've had problems only with
the number 2.5, but I assume that there is more than one number that gives
wrong output.)
Here a