[Python-ideas] Python Float Update

Steven D'Aprano steve at pearwood.info
Thu Jun 4 17:11:39 CEST 2015

On Wed, Jun 03, 2015 at 03:18:51PM -0700, u8y7541 The Awesome Person wrote:
> > I'm going to show a few examples of how Decimals violate the fundamental
> > laws of mathematics just as floats do.
> Decimal is also uses sign and mantissa, except it's Base 10. I think
> Decimal should use numerators and denominators, because they are more
> accurate. That's why even Decimal defies the laws of mathematics.

The decimal module is an implementation of the decimal floating point 
arithmetic based on the General Decimal Arithmetic Specification:


and IEEE standard 854-1987:

The decimal module is not free to do whatever we want. It can only do 
what is specified by those standards. If you want to modify the decimal 
module to behave as you suggest, you are free to copy the module's 
source code and modify it. (It is open source, like all of Python.) This 
would be an interesting experiment for somebody to do.


More information about the Python-ideas mailing list