[Python-ideas] float vs decimal

Chris Rebert pyideas at rebertia.com
Wed Mar 11 20:48:17 CET 2009


On Wed, Mar 11, 2009 at 12:25 PM, William Dode <wilk at flibuste.net> wrote:
> Hi,
>
> I just read the blog post of gvr :
> http://python-history.blogspot.com/2009/03/problem-with-integer-division.html
>
> And i wonder why
>>>> .33
> 0.33000000000000002
> is still possible in a "very-high-level langage" like python3 ?
>
> Why .33 could not be a Decimal directly ?

I proposed something like this earlier, see:
http://mail.python.org/pipermail/python-ideas/2008-December/002379.html
Obviously, the proposal didn't go anywhere, the reason being that
Decimal is currently implemented in Python and is thus much too
inefficient to be the default (efficiency/practicality beating
correctness/purity here apparently). There are non-Python
implementations of the decimal standard in C, but no one could locate
one with a Python-compatible license. The closest was the IBM
implementation whose spec the decimal PEP was based off of, but
unfortunately it uses the ICU License which has a classic-BSD-like
attribution clause.

Cheers,
Chris

-- 
I have a blog:
http://blog.rebertia.com



More information about the Python-ideas mailing list