[Python-bugs-list] [ python-Bugs-500626 ] round (,) errors?
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 08 Jan 2002 13:57:55 -0800
Bugs item #500626, was opened at 2002-01-07 14:28
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=500626&group_id=5470
Category: Python Interpreter Core
Group: Python 2.2
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Patrick Kennedy (kennedyp)
Assigned to: Nobody/Anonymous (nobody)
Summary: round (,) errors?
Initial Comment:
>From my Win2K Pro/SP1 interactive session:
Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for
more information.
>>> a=3.1415928*7*7
>>> a
153.9380472
>>> round (a,2)
153.94
>>> round (a,1)
153.90000000000001
>>> round (a,3)
153.93799999999999
>>> round (a,4)
153.93799999999999
>>> round (a,5)
153.93805
>>> round (a,6)
153.93804700000001
>>>
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2002-01-08 13:57
Message:
Logged In: YES
user_id=21627
This is not a bug in Python, see
http://www.python.org/doc/FAQ.html#4.98
153.94 cannot be represented exactly in your computer, so
Pyton won't claim it can.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=500626&group_id=5470