En Tue, 05 Aug 2008 11:50:43 -0300, schinckel <[EMAIL PROTECTED]> escribió:
> I had a class today which dealt with Decimal <-> IEE754 conversion, > and > whilst 0.1 was an example that was converted, and a representation was > generated, no mention was made of the precision issue. > > I'm hoping that it was just that we ran out of time, and the lecturer > will discuss it in detail next time. Presumably you encountered that 0.1 (decimal) = 0.000110011001100... (binary), and as you can see it has infinite periodic bits. IEEE754 stores only a finite number of bits for the mantissa, all the remaining (infinite) bits are dropped; a representation error is unavoidable. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list