[IronPython] Singles not comparing properly
Dave Fugate
dfugate at microsoft.com
Wed Nov 15 21:54:57 CET 2006
Thanks for reporting this! The bug is that <, <=, >, and >= do not work when the left operand
is a System.Single and the right operand is just about any integer type (CLR or Python).
The CodePlex Work Item for this is http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=5682
-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mujtaba Syed
Sent: Friday, November 03, 2006 1:55 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Singles not comparing properly
Also note that:
>>> 5.0 <= s <= 500.0
True
>>> 5.0 <= d <= 500.0
True
-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Christian Muirhead
Sent: Friday, November 03, 2006 3:25 AM
To: users at lists.ironpython.com
Subject: [IronPython] Singles not comparing properly
Hi guys -
We encountered a strange bug today, which we eventually worked out was
being caused by the fact that a number we thought was a float (a Double)
was actually a Single. The problem was this:
>>> from System import Double, Single
>>> d = Double(8.0)
>>> d
8.0
>>> 5 <= d <= 500
True
>>> s = Single(8.0)
>>> s
8.0
>>> 5 <= s <= 500
False
There's no real analogue to this in CPython, but it feels like Single
and Double should behave the same here. Is this a bug?
Thanks,
Christian
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
More information about the Ironpython-users
mailing list