Why does int(5.0) returns 0

spatel spatel at cinci.rr.com
Mon Jan 27 00:16:25 EST 2003


I know that my python is seriously broken, but recompiling it with no
optimization and compiling cvs version of python does not solve it. I am
suspecting gcc or glibc (which I have install with pentium4 and -O3
optimization) is the culprit. I am recompiling glibc and gcc to see whether
that will solve it or not.

Here is the output:

********************************************************

bash-2.05b# python             
Python 2.2.2 (#1, Jan 26 2003, 18:38:47) 
[GCC 3.2.1 20021207 (Gentoo Linux 3.2.1-20021207)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> int(5.0)
0
>>> int (5)
5
>>> 






More information about the Python-list mailing list