[Numpy-discussion] problem with float64's str()
Dag Sverre Seljebotn
dagss at student.matnat.uio.no
Fri Apr 4 09:52:17 EDT 2008
Bruce Southey wrote:
> Hi,
> This topic has come up many times and the only problem is the lack of
> understanding how computers store numbers and computer numerical precision.
>
> The NumPy output is consistent with Python on my x86_64 linux system
> with Python 2.5.1:
> >>> a=0.0012
> >>> a
> 0.0011999999999999999
>
Wasn't this discussion about the repr vs. str functions?
>>> repr(0.0012)
'0.0011999999999999999'
>>> str(0.0012)
'0.0012'
Dag Sverre
More information about the NumPy-Discussion
mailing list