[issue15882] _decimal.Decimal constructed from tuple

Mark Dickinson report at bugs.python.org
Sat Sep 8 12:54:05 CEST 2012


Mark Dickinson added the comment:

> read-only interface:
>
>     x.sign   -> 0 or 1 (perhaps even 1 or -1)
>     x.coeff  -> Python integer
>     x.exp    -> Python integer

The only slightly awkward thing with this (for high-precision decimals) is the quadratic conversion (well, okay, perhaps subquadratic depending on what algorithms are being used, but still ...) required to get from the decimal coefficient to a Python integer, and vice versa.  It may be better to use a (byte)string of digits instead of a Python integer for the coefficient.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15882>
_______________________________________


More information about the Python-bugs-list mailing list