You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 2.7 and 3.1 now always use the shortest decimal representation for numbers that are not exactly representable by a binary float (see [http://bugs.python.org/issue1580]).
This causes some very surprising inconsistencies with NumPy's own repr:
x = 0.1
x
0.1
a = np.array([x])
a
array([ 0.1])
a[0]
0.10000000000000001
float(a[0])
0.1
type(a[0])
<class 'numpy.float64'>
For the sake of consistency I suggest adopting the same repr in NumPy.
The text was updated successfully, but these errors were encountered:
Original ticket http://projects.scipy.org/numpy/ticket/2051 on 2012-02-12 by trac user beaujolais, assigned to unknown.
Python 2.7 and 3.1 now always use the shortest decimal representation for numbers that are not exactly representable by a binary float (see [http://bugs.python.org/issue1580]).
This causes some very surprising inconsistencies with NumPy's own repr:
For the sake of consistency I suggest adopting the same repr in NumPy.
The text was updated successfully, but these errors were encountered: