[ python-Bugs-1650053 ] decimals compare badly to floats

SourceForge.net noreply at sourceforge.net
Thu Feb 1 19:20:59 CET 2007


Bugs item #1650053, was opened at 2007-02-01 19:20
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1650053&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Brian Sutherland (jinty_)
Assigned to: Nobody/Anonymous (nobody)
Summary: decimals compare badly to floats

Initial Comment:
This behaviour is so unexpected that I'm pretty sure it's a bug. If decimals can't be compared to floats, at least it should error.

Found in python2.4 and 2.5 by at least 2 people:

Python 2.5 (release25-maint, Dec  9 2006, 14:35:53)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-20)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from decimal import Decimal
>>> 1172837167.27 > Decimal("1172837136.0800")
False
>>> 1172837167.27 > Decimal("1")
False


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

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


More information about the Python-bugs-list mailing list