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

Alexander Belopolsky alexander.belopolsky at gmail.com
Sun Mar 9 01:06:39 CET 2014


On Sat, Mar 8, 2014 at 6:44 PM, Mark H. Harris <harrismh777 at gmail.com>wrote:

> There are two user issues:
>
>    1) maths should not give surprises
>
>    2) inputs should have a reasonable "expected" interpretation
>

I am with Mark H. on this.  While I appreciate the theoretical
underpinnings of the status quo, I am yet to see data stored in binary that
did not originate from decimal at some point.  I think 99.999% of all
instances of 0x1.199999999999ap+0 in numerical data come from a conversion
of 1.1 from decimal to float rather than an a result of a computation that
is correct to 16+ decimal places.

In a well-designed system, simple things should be simple and difficult
things should be possible.  Decimal(x) = Decimal(str(x)) is simple and what
most users expect and ultimately need.  Expert users will always
have Decimal.from_float, contexts, round and other power tools at their
disposal.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140308/3daf6b7b/attachment.html>


More information about the Python-ideas mailing list