-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Closed
Labels
00 - BugtriagedIssue/PR that was discussed in a triage meetingIssue/PR that was discussed in a triage meeting
Description
Based on official python doc, the output of round function is integer when ndigits is omitted. However, numpy does not follow this rule, and the output of rounded numpy still is a float. I think this behavior cause bugs!
Reproducing code example:
>>> for x in np.linspace(0,1,5):
... print(round(x * 5.))
...
0.0
1.0
2.0
4.0
5.0
>>> for x in map(float,np.linspace(0,1,5)):
... print(round(x * 5.))
...
0
1
2
4
5Numpy/Python version information:
1.18.1 3.5.2 (default, Oct 8 2019, 13:06:37)
[GCC 5.4.0 20160609]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
00 - BugtriagedIssue/PR that was discussed in a triage meetingIssue/PR that was discussed in a triage meeting