PEP 327: Decimal Data Type

Mel Wilson mwilson at
Tue Feb 3 17:02:15 CET 2004

In article <bvmh58$4hc$1 at>,
Josiah Carlson <jcarlson at> wrote:
>> But if you normalise every time, some theoretically simple operations
>> can become relatively very expensive in terms of time. (Basically,
>> things like addition, which suddenly require a GCD calculation).
>If we are to take cues from standard Python numeric types, any
>mathematical calculation results in a new immutable object.  Thusly,
>only normalizing on initialization is sufficient.  Since that is the
>only time you ever get anything new, doing GCD on initialization is the
>minimum and maximum requirement.

   I agree, but that means we do a lot of initializations,
so the performance in doing a computation would be about the

   I tried a decimal floating-point package just lately, for
fun, based on long mantissas and int exponents.  I used this
approach to normalization, because I think it's natural, but
I've been scared to benchmark the package.  I should, I

        Regards.        Mel.

More information about the Python-list mailing list