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

Mark H. Harris harrismh777 at gmail.com
Sun Mar 9 02:58:18 CET 2014



On Saturday, March 8, 2014 6:39:25 PM UTC-6, Steven D'Aprano wrote:
 

> py> x = 1/Decimal(3) 
> py> sum([x, x, x]) == 1 
> False 
>
> "No surprises" is simply an impossible request. 
>

hi Steven,  that's a straw man.   Your argument presumes that False is a 
surprise.  I am
not in the least surprised.  As, I am also not surprised by this:

>>> dscale(32)
10100
>>> d(1)/3
Decimal('0.33333333333333333333333333333333')   <=== not a surprise, 
expected
>>> d(1)/3 + d(1)/3 +d(1)/3
Decimal('0.99999999999999999999999999999999')   <=== not a surprise either, 
quite expected
>>> 

And following:

>>> dscale(42)
32
>>> dSum= d(1)/3 + d(1)/3 +d(1)/3
>>> dscale(38)
42
>>> +dSum     <=====   at this point I expect to see the following line, 
just as I see it./
Decimal('1.0000000000000000000000000000000000000')
>>> 

 Cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140308/81b05f1b/attachment-0001.html>


More information about the Python-ideas mailing list