[New-bugs-announce] [issue36082] The built-in round() function giving a wrong output

Juho Pesonen report at bugs.python.org
Fri Feb 22 12:02:23 EST 2019


New submission from Juho Pesonen <juho.pesonen at outlook.com>:

As the title says I have got some wrong outputs with the round() built-in function.
The bug occurs only with certain numbers though. (I've had problems only with the number 2.5, but I assume that there is more than one number that gives wrong output.)
Here are some outputs with the round built-in function:

>>>round(2.5)
2
>>>round(2.51)
3
>>>round(3.5)
4
>>>round(1.5)
2

As you can see the number 2.5 gives 2 instead of 3.

----------
messages: 336329
nosy: Goodester
priority: normal
severity: normal
status: open
title: The built-in round() function giving a wrong output
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36082>
_______________________________________


More information about the New-bugs-announce mailing list