My Python & co. stuff

Archive for October 2009

Another Python gotcha?

>>> a
12.878
>>> b
Decimal('15.0')
>>> a > b
True
>>> type(a)
<type 'float'>
>>> type(b)
<class 'decimal.Decimal'>
>>> 1.0 > Decimal('1.0')
True
>>> 0.0 > Decimal('0.0')
True
>>> 1.0 > Decimal('1.0') True >>> 0.0 > Decimal('0.0') True