Repository navigation
DOC: update np.around docstring with note about floating-point error - #14392
Conversation
ec54f23 to
f03ead4
Compare
There was a problem hiding this comment.
Remove hyphen in float-printing?
There was a problem hiding this comment.
Probably want double backticks here, the single ticks would try to make a link, which seems redundant.
There was a problem hiding this comment.
This and some others in this paragraph appear in italics in the rendered doc, they should have double backticks or be fixed to resolve to a link.
There was a problem hiding this comment.
Does this need "::'? I'm a bit concerned that some of these might make it as doctests. Or is that intended? Most doctests are not indented.
There was a problem hiding this comment.
nit: decimals is a parameter, so it only really needs single backticks not double. It is find as code as well, so I am not sure it has to be changed.
There was a problem hiding this comment.
The rendering of the PR links to the python documentation here
We should update the docs anyway, then we can leave it in there as a note about how it behaved on older versions if we do eventually fix it. |
cbdfe46 to
c4377c2
Compare
|
LGTM, one small nit about |
|
@mattip No, I expect you are more familiar with the document markup than I am at this point. You might just go ahead and fix the nit. |
c4377c2 to
2ca7ea9
Compare
|
Fixed up the decimals quotes, I think. |
|
Thanks @ahaldane it reads well now. |
Fixes #14391
This just updates the docstring to clarify how this function is inexact for some floating-point values.
(An alternative might be to try to "fix" the np.around algorithm, either by using the BigInt algorithm of the float-printing routines, some simplified bigger-int method, and perhaps also special casing the range of values that are problematic. It's hard to tell how much faster the current algorithm is to a BigInt algorithm, because I find it hard to separate the vectorization speedups in numpy from the round optimizations vs plain python).