REPOST: Re: Is this a bug?

John W. Baxter jwbaxter at spamcop.net
Sat Dec 29 00:36:06 EST 2001


In article <33e9b770.0112281857.563a36d4 at posting.google.com>, Gilbert
<blessed at mail.com> wrote:

> Hi!
> 
> I am wondering if the following results below imply any bug in Python
> 2.2 or 2.1?
> When I try to use float numbers, python 2.2 and 2.1.1 shows a little
> bit different results (I think it is incorrect) from what I enter. 
> But python 1.5.2 seems to be okay?  What is wrong?
> 
> If you know why and how they are different, please let me know.
> 
> Thanks!
> 
> -----------------------------------
> 
> Python 2.2 (#1, Dec 23 2001, 09:30:32) 
> [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> 653.34
> 653.34000000000003
> >>>
> 
> -----------------------------------
> 
> Python 1.5.2 (#1, Oct 13 2001, 09:06:03)  [GCC 2.96 20000731 (Red Hat
> Linux 7.1 2 on linux-i386
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> >>> 653.34
> 653.34
> >>>

Python 1.5.2 is lying to you (by rounding off).  Later versions are
telling you the unpleasant truth.  653.34 doesn't exist in the
representation used.  [653.00, 653.25, 653.50, and 653.75 do
exist...the other 96 are approximated.]

YAPDFP

  --John

========= WAS CANCELLED BY =======:
Path: news.sol.net!spool1-nwblwi.newsops.execpc.com!newsfeeds.sol.net!news-out.visi.com!hermes.visi.com!news.tele.dk!small.news.tele.dk!134.75.7.11!nntp.kreonet.re.kr!feeder.kornet.net!news1.kornet.net!ua4canc3ll3r
From: "John W. Baxter" <jwbaxter at spamcop.net>
Newsgroups: comp.lang.python
Subject: cmsg cancel <281220012136066403%jwbaxter at spamcop.net>
Control: cancel <281220012136066403%jwbaxter at spamcop.net>
Date: Mon, 31 Dec 2001 01:33:21 GMT
Organization: A poorly-installed InterNetNews site
Lines: 2
Message-ID: <cancel.281220012136066403%jwbaxter at spamcop.net>
NNTP-Posting-Host: 211.57.49.2
X-Trace: news2.kornet.net 1009774865 27193 211.57.49.2 (31 Dec 2001 05:01:05 GMT)
X-Complaints-To: usenet at news2.kornet.net
NNTP-Posting-Date: Mon, 31 Dec 2001 05:01:05 +0000 (UTC)
X-No-Archive: yes
X-Unac4ncel: yes
X-Commentary: I love NewsAgent 1.10 and the Sandblaster Cancel Engine Build 74 (19 March 1999)

This message was cancelled from within Mozilla.



More information about the Python-list mailing list