<p dir="auto">Not sure if this is a bug or there is simply a discrepancy between NumPy and Python. Though this is what I am seeing in some (not all) cases. FYI, similar (but not the exact same) behavior for <code class="notranslate">np.float128</code>.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; a = np.float64(0.47140452079103168)
&gt;&gt;&gt; round(a, 4)
0.47139999999999999
&gt;&gt;&gt; a = np.float64(0.47140452079103168)
&gt;&gt;&gt; round(float(a), 4)
0.4714
&gt;&gt;&gt; a = 0.47140452079103168
&gt;&gt;&gt; round(a, 4)
0.4714"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; a = np.float64(0.47140452079103168)
&gt;&gt;&gt; round(a, 4)
0.47139999999999999
&gt;&gt;&gt; a = np.float64(0.47140452079103168)
&gt;&gt;&gt; round(float(a), 4)
0.4714
&gt;&gt;&gt; a = 0.47140452079103168
&gt;&gt;&gt; round(a, 4)
0.4714
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: np.array(.1)[()] == np.array(.1).item()
Out[1]: True

In [2]: np.array(.1)[()] # a np.float64
Out[2]: 0.10000000000000001

In [3]: np.array(.1).item() # a python (64-bit) float
Out[3]: 0.1"><pre class="notranslate"><code class="notranslate">In [1]: np.array(.1)[()] == np.array(.1).item()
Out[1]: True

In [2]: np.array(.1)[()] # a np.float64
Out[2]: 0.10000000000000001

In [3]: np.array(.1).item() # a python (64-bit) float
Out[3]: 0.1
</code></pre></div>
<p dir="auto">Python floats use the shortest repr that give the same value when eval'd since <a href="https://bugs.python.org/issue1580" rel="nofollow">https://bugs.python.org/issue1580</a> was accepted.  It would be nice if numpy did the same.</p>
<p dir="auto">I realize it would require a nontrivial patch :)</p>