A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-January/075863.html below:

[Python-Dev] Return type of round, floor, and ceil in 2.6

[Python-Dev] Return type of round, floor, and ceil in 2.6Guido van Rossum guido at python.org
Fri Jan 4 18:05:43 CET 2008
On Jan 4, 2008 8:58 AM,  <skip at pobox.com> wrote:
>
>     Guido> Looks like in Python 2.6, round(0.5) right now returns 0.0,
>     Guido> whereas in 2.5, it returns 1.0.
>
>     Guido> I think it should return 1.0, for best compatibility with Python
>     Guido> 2.5.
>
> And for best compatibility with everything else! <0.5 wink>

Should I round that to 0 whole winks or 1 whole wink?

Rounding 0.5 to 0 is a new fad, called round-to-even, or
statistician's rounding. Read http://en.wikipedia.org/wiki/Rounding .
It's a standard, and more correct when doing statistical calculations.
That's why we've chosen it for Python 3.0. But it should not bleed
into Python 2.6.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4