[Python-Dev] Mixing float and Decimal -- thread reboot

Nick Coghlan ncoghlan at gmail.com
Mon Mar 22 11:41:10 CET 2010


Greg Ewing wrote:
> Raymond Hettinger wrote:
>>
>> Remember, the notion of inexactness is a taint,
>> not an intrinsic property of a type.  Even the Scheme numeric
>> tower recognizes this.  LIkewise, the decimal specification also
>> spells-out this notion as basic to its design.
> 
> I'm not sure it really does, otherwise every decimal
> value would have a flag indicating whether it was
> tainted with inexactness, and this flag would propagate
> through calculations.

http://docs.python.org/library/decimal.html#decimal.Inexact

(Part of the thread context rather than the individual decimal values,
but if you use it properly it tells you whenever an inexact operation
has occurred in the current thread)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------


More information about the Python-Dev mailing list