Closed
Description
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
Python floats use the shortest repr that give the same value when eval'd since https://bugs.python.org/issue1580 was accepted. It would be nice if numpy did the same.
I realize it would require a nontrivial patch :)
Metadata
Metadata
Assignees
Labels
No labels