[issue36082] The built-in round() function giving a wrong output

2019-02-22 Thread Rémi Lapeyre
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. --

[issue36082] The built-in round() function giving a wrong output

2019-02-22 Thread SilentGhost
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

[issue36082] The built-in round() function giving a wrong output

2019-02-22 Thread Karthikeyan Singaravelan
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

[issue36082] The built-in round() function giving a wrong output

2019-02-22 Thread Juho Pesonen
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