This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: round() doesn't return the right value when I put 0.5 in it.
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7, Python 3.6, Python 3.4, Python 3.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Mingun Pak, corona10
Priority: normal Keywords:

Created on 2019-01-21 05:49 by Mingun Pak, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Screen Shot 2019-01-20 at 9.40.52 PM.png Mingun Pak, 2019-01-21 05:49
Messages (2)
msg334112 - (view) Author: Mingun Pak (Mingun Pak) Date: 2019-01-21 05:49
It should be 1, but it returns 0.
msg334113 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2019-01-21 05:55
Please read the documentation of round builtin function.
https://docs.python.org/3/library/functions.html#round

For the built-in types supporting round(), values are rounded to the closest multiple of 10 to the power minus ndigits; if two multiples are equally close, rounding is done toward the even choice (so, for example, both round(0.5) and round(-0.5) are 0, and round(1.5) is 2).
History
Date User Action Args
2022-04-11 14:59:10adminsetgithub: 79974
2019-01-21 06:00:06ned.deilysetstatus: open -> closed
resolution: not a bug
stage: resolved
2019-01-21 05:55:54corona10setnosy: + corona10
messages: + msg334113
2019-01-21 05:49:50Mingun Pakcreate