[Numpy-discussion] problem with float64's str()

Dag Sverre Seljebotn dagss@student.matnat.uio...
Fri Apr 4 08:52:17 CDT 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