[Python-Dev] Unifying decimal numbers.

Josiah Carlson jcarlson at uci.edu
Tue Nov 8 19:26:16 CET 2005


winlinchu <winlinchu at yahoo.it> wrote:
> Now, Python unified ints and long ints.
> For Python 3k, could be introduced a "Decimal" type
> (yes, Decimal, the library module!) in place of the
> actual float object. Of course, the Decimal type would
> be rewritten in C.

There is code which relies on standard IEEE 754 floating point math
(speed, behavior, rounding, etc.) that would break with the replacement
of floats with decimals.  Further, even if it were to be converted to C,
it would likely be hundreds of times slower than the processor-native
float operations.

This discussion has been had before use:
    site:mail.python.org decimal replace float python
in google to discover such discussions.  For example:
    http://mail.python.org/pipermail/python-dev/2005-June/054416.html


 - Josiah



More information about the Python-Dev mailing list