[Python-ideas] Python Numbers as Human Concept Decimal System

Nick Coghlan ncoghlan at gmail.com
Tue Mar 11 14:42:19 CET 2014


On 11 Mar 2014 23:31, "Antoine Pitrou" <solipsis at pitrou.net> wrote:
>
> Le 11/03/2014 11:51, Oscar Benjamin a écrit :
>
>
>> The decimal.Decimal type is IMO overly complex
>> and should really be for niche use-cases like other non-stdlib
>> multi-precision numeric types.
>
>
> What is complex about it?

What is the result of "Decimal('1.0') + Decimal('1e70')"?

Correct answer: insufficient data (since we don't know the current
precision).

That becomes a substantially more questionable answer for "1.0d + 1e70d".
Having apparent numeric literals that can't be constant folded would be a
much bigger design wart than having two different kinds of decimal.

Cheers,
Nick.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140311/193e0481/attachment.html>


More information about the Python-ideas mailing list