[issue21929] Rounding properly

2020-05-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Python 2.7 is no longer supported. -- nosy: +serhiy.storchaka resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker

[issue21929] Rounding properly

2014-10-14 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: -skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21929 ___ ___ Python-bugs-list

[issue21929] Rounding properly

2014-09-08 Thread Robert
Robert added the comment: I'm not sure if this is related or not, but on 3.4.1 I get the following: print(round(float(3/2))) 2 (as expected) print(round(float(5/2))) 2 (expected 3, as float should round .5 up) -- nosy: +fenofonts ___ Python

[issue21929] Rounding properly

2014-09-08 Thread Geoffrey Spear
Geoffrey Spear added the comment: Robert: That is not related. Python 3's round() function, as documented, rounds halves to the even choice; what you describe is the expected behavior. -- nosy: +geoffreyspear ___ Python tracker

[issue21929] Rounding properly

2014-07-07 Thread Jeroen de Jong
New submission from Jeroen de Jong: I ma trying to find a way to round correctly. So far I get unexpected results for some values. -- components: Windows files: Rounding.py messages: 222444 nosy: jeroen1225 priority: normal severity: normal status: open title: Rounding properly type:

[issue21929] Rounding properly

2014-07-07 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +mark.dickinson, skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21929 ___ ___

[issue21929] Rounding properly

2014-07-07 Thread Mark Dickinson
Mark Dickinson added the comment: This is working as designed, though admittedly the cause of the unexpected results is non-obvious. In Python 2, there's no way to implement `round` for a general type: instead, the `round` function converts its *input* to a Python (binary) float, and then

[issue21929] Rounding properly

2014-07-07 Thread Mark Dickinson
Mark Dickinson added the comment: There may be an opportunity for a documentation improvement here: it would be helpful if the Python 2.7 documentation for the round function explained that its input is converted to float. -- assignee: - docs@python components: +Documentation

[issue21929] Rounding properly

2014-07-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, the FAQ in the decimal docs shows how to round Decimal objects using the quantize() method: https://docs.python.org/2.7/library/decimal.html#decimal-faq Unfortunately, only it Python 3 does the one-obvious-way-to-do-it work. -- nosy: