[Tutor] Fw: About the Round Function

Ben Finney ben+python at benfinney.id.au
Fri Apr 1 21:13:46 EDT 2016


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?

The term “Banker's rounding algorithm” is not familiar to me. What does
the Python documentation say about it, and where?

> We'd also like to know how the function is actually implemented.

What kind of answer to “how it is implemented” do you want?

At one level, it can be answered with the source code of CPython
<URL:https://www.python.org/downloads/source/>. Perhaps you want a
different answer, but what?

-- 
 \           “We spend the first twelve months of our children's lives |
  `\          teaching them to walk and talk and the next twelve years |
_o__)           telling them to sit down and shut up.” —Phyllis Diller |
Ben Finney



More information about the Tutor mailing list