New submission from Scaler <balato...@hotmail.com>:

round()'s documentation 
(https://docs.python.org/3/library/functions.html#round) says that "The return 
value is an integer if ndigits is omitted or None."

Works well with "built-in floats", but not with "numpy floats" (didn't know 
they were different):
>>> import numpy as np
>>> round(5.5)
6
>>> round(np.round(5.5)-0.5)
6.0



As a side note, is there any reason why round() does not return value as an 
integer if ndigits is 0 or negative also?

----------
messages: 342132
nosy: Scaler
priority: normal
severity: normal
status: open
title: bug with round() and "numpy floats"
type: behavior
versions: Python 3.6

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

Reply via email to