New submission from Clinton Curry:

In the current Python 2.7 documentation, Section 5.4

https://docs.python.org/2.7/library/stdtypes.html

the result of the round function is described as "x rounded to n digits, 
rounding half to even. If n is omitted, it defaults to 0."  However, my 
observed behavior (Python 2.7.4 (default, Apr  6 2013, 19:55:15) [MSC v.1500 64 
bit (AMD64)] on win32) does not round half to even, but rounds half away from 
zero.

>>> round(1.5)
2.0
>>> round(2.5)
3.0
>>> round(-1.5)
-2.0
>>> round(-2.5)
-3.0

I observe similar behavior on other platforms.

----------
assignee: docs@python
components: Documentation
messages: 215753
nosy: Clinton.Curry, docs@python, eric.araujo, ezio.melotti, georg.brandl
priority: normal
severity: normal
status: open
title: Rounding half to even
versions: Python 2.7

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

Reply via email to