On Apr 9, 8:35 pm, Mark Dickinson <[EMAIL PROTECTED]> wrote:
> Strictly speaking, BCD doesn't come into it: the coefficient of a
> Decimal instance is stored simply as a string of digits. This is
> pretty wasteful in terms of space: 1 byte per decimal digit
> instead of the 4 bits per digit that BCD gives, but it's
> convenient and fairly efficient.
>
> An alternative representation that's gained popularity recently is
> DPD (densely packed decimal), which packs 3 decimal digits into 10
> bits in a clever way that allows reasonably efficient extraction
> of any one of the 3 digits. Decimal doesn't use this either. :)
>
> Mark
Naive question: why not just use a long + an exponent?
e.g. 132560 -> (13256, 1)
0.534 -> (534, -3)
5.23e10 -> (523, 8)
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list