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

Karthikeyan Singaravelan report at bugs.python.org
Fri Feb 22 12:07:34 EST 2019


Karthikeyan Singaravelan <tir.karthi at gmail.com> added the comment:

https://docs.python.org/3/whatsnew/3.0.html

> The round() function rounding strategy and return type have changed. Exact halfway cases are now rounded to the nearest even result instead of away from zero. (For example, round(2.5) now returns 2 rather than 3.) round(x[, n]) now delegates to x.__round__([n]) instead of always returning a float. It generally returns an integer when called with a single argument and a value of the same type as x when called with two arguments.

----------
nosy: +xtreak

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


More information about the Python-bugs-list mailing list