Dennis Sweeney <sweeney.dennis...@gmail.com> added the comment:

Thanks for the report, but this is the intended behavior.

>From https://docs.python.org/3/library/functions.html#round :

"""values are rounded to the closest multiple of 10 to the power minus ndigits; 
if two multiples are equally close, rounding is done toward the even choice 
(so, for example, both round(0.5) and round(-0.5) are 0, and round(1.5) is 2)"""

This is called "round-half-to-even" or "Banker's rounding" (see 
https://en.wikipedia.org/wiki/Rounding#Round_half_to_even) and it's used to 
prevent the upward bias that would happen if we always rounded halfway points 
up.

----------
nosy: +Dennis Sweeney
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45715>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to