Python float representation error?
jstroud at ucla.edu
Mon Mar 27 02:02:01 CEST 2006
mailpitches at email.com wrote:
> try running this in python:
> print [39.95]
> the output i get is:
> what's up with that?
This comes from the imprecision in representing base-10 fractions as
binary. Try "print [str(39.95)]".
If you want to print a list, maybe:
print map(str, alist)
UCLA-DOE Institute for Genomics and Proteomics
Los Angeles, CA 90095
More information about the Python-list