ValueError: invalid literal for int(): 1.0000000000e+00

Fredrik Lundh fredrik at pythonware.com
Mon Feb 14 12:08:59 EST 2005


Martin MOKREJ© wrote:

> is this a bug or "feature" that I have to use float() to make int() autoconvert
> from it?

it's by design, of course.   "1.0000000000e+00" is not an integer.

if you want to treat a floating point literal as an integer, you have to
use an explicit conversion.

</F> 






More information about the Python-list mailing list