[Python-Dev] Change in Python 3's "round" behavior

Mansour Moufid mansourmoufid at gmail.com
Sun Sep 30 21:23:26 EDT 2018

On Wed, Sep 26, 2018 at 7:29 AM <jab at math.brown.edu> wrote:
> I recently found out about Python 3's round-to-even change (via
> https://github.com/cosmologicon/pywat!) and am having trouble finding
> where that change was discussed.

That GitHub project is hilarious especially the NaN stuff...

Rounding is from engineering so there is more than one definition, and
one is not more correct than the others, it just depends on the
specific application. Functions like ceiling and floor do have
mathematical definitions. Whichever definition of rounding the Python
standard library adopts, it should be very explicitly defined in the
documentation in terms of ceiling and floor.

In applications where rounding is actually important, it's a good idea
to do calculations with one rounding function, and again with another,
and compare results.

More information about the Python-Dev mailing list