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

$ python
Python 2.3.4 (#1, Feb 14 2005, 10:00:27) [GCC 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
a = 1
"%5.10e" % (a)
'1.0000000000e+00'
int("%5.10e" % (a))
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
ValueError: invalid literal for int(): 1.0000000000e+00
int(float("%5.10e" % (a)))
1

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to