Skip to content

DOC: tweak np.round docstring to clarify floating-point error - #14503

Merged
mattip merged 1 commit into
numpy:masterfrom
ahaldane:tweak_round_docstring
Sep 14, 2019
Merged

mattip merged 1 commit into
numpy:masterfrom
ahaldane:tweak_round_docstring

Conversation

@ahaldane

Copy link
Copy Markdown
Member

Clarifies the docstring based on this discussion
https://mail.python.org/pipermail/numpy-discussion/2019-September/080034.html
https://mail.python.org/pipermail/numpy-discussion/2019-September/080044.html

To summarize, the behavior:

>>> np.round(16.055, 2), round(16.055, 2)  # equals 16.0549999999999997
(16.06, 16.05)

shows that floating-point error occurs for small values, not just large values like the np.round docstring says.

So this PR removes the red-herring comment about large values.

@mattip

mattip commented Sep 14, 2019

Copy link
Copy Markdown
Member

Thanks @ahaldane

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants