[Tutor] Fw: About the Round Function

Danny Yoo dyoo at hashcollision.org
Sat Apr 2 07:38:44 EDT 2016


On Fri, Apr 1, 2016 at 6:13 PM, Ben Finney <ben+python at benfinney.id.au> wrote:
> Nacir Bouali <N.Bouali at aui.ma> writes:
>
>> My students and I are interested in knowing the rationale behind
>> Python's choice of the Banker's rounding algorithm to be the default
>> rounding algorithm in the third release of Python.
>
> Can you provide a link to the Python documentation for this?


Hi Ben,


Rounding behavior is one of the things that changed in Python 3.0.
See the "Builtins" section in:

    https://docs.python.org/3/whatsnew/3.0.html#builtins


As far as I can tell, discussion of the possibility of changing this
started around Python 2.6 time:

    https://mail.python.org/pipermail/python-dev/2008-January/075798.html


with the reasoning behind the switch because it has nicer statistical
properties.  The following messages on that thread are especially
interesting:

    https://mail.python.org/pipermail/python-dev/2008-January/075863.html
    https://mail.python.org/pipermail/python-dev/2008-January/075866.html
    https://mail.python.org/pipermail/python-dev/2008-January/075873.html


More information about the Tutor mailing list