Why does int(5.0) returns 0

Michael.Coll-Barth at VerizonWireless.com Michael.Coll-Barth at VerizonWireless.com
Sun Jan 26 23:14:12 EST 2003


Samir,

Here's what I get...

Python 2.2.1 (#34, Apr  9 2002, 19:34:33) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
IDLE 0.8 -- press F1 for help
>>> print int(5.0)
5
>>> 

Michael

-----Original Message-----
From: Erik Max Francis [mailto:max at alcyone.com]
Sent: Sunday, January 26, 2003 11:08 PM
To: python-list at python.org
Subject: Re: Why does int(5.0) returns 0


Samir Patel wrote:

> Here is verbose output of program: print int(5.0)
> 
> It outputs 0

You should us verbose output, but not your input.  Are you really sure
that's what the program said?  If so, your Python installation is
seriously broken.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ This moment is mine / So I'm taking my time
\__/ Chante Moore
    Church / http://www.alcyone.com/pyos/church/
 A lambda calculus explorer in Python.
-- 
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list