[Python-bugs-list] [ python-Bugs-430200 ] corrupt floats in lists & tuples

noreply@sourceforge.net noreply@sourceforge.net
Mon, 04 Jun 2001 22:10:34 -0700


Bugs item #430200, was updated on 2001-06-04 22:10
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=430200&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: corrupt floats in lists & tuples

Initial Comment:
C Python 2.1 on GNU/Linux Mandrake-7.2.  Intel PIII.
Compiled from sources.

Assigning a tuple or list of floating-point numbers
returns corrupted numbers.  In the interpreter with
nothing imported: 
>>> t = (0.5, 0.6, 0.76, 0.1)
>>> t
(0.5, 0.59999999999999998, 0.76000000000000001,
0.10000000000000001)
>>> t = (1.5, 2.26, 3.76, 4.1)
>>> t
(1.5, 2.2599999999999998, 3.7599999999999998,
4.0999999999999996)
>>> l = [1.5, 2.26, 3.76, 4.1]
>>> l
[1.5, 2.2599999999999998, 3.7599999999999998,
4.0999999999999996]

At least one other identical case so far exists in my
Python Authors Group.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=430200&group_id=5470