[Python-ideas] Python Numbers as Human Concept Decimal System
Alexander Belopolsky
alexander.belopolsky at gmail.com
Sun Mar 9 03:12:53 CET 2014
On Sat, Mar 8, 2014 at 7:39 PM, Steven D'Aprano <steve at pearwood.info> wrote:
> Computer maths cannot fail to give surprises.
>
> py> x = 1/Decimal(3)
> py> sum([x, x, x]) == 1
> False
>
> "No surprises" is simply an impossible request.
>
Maybe, but there is nothing impossible in eliminating this particular
surprise:
q)x:1 % 3f
q)x
0.3333333
q)1 = x + x + x
1b
http://en.wikipedia.org/wiki/Q_(programming_language_from_Kx_Systems)
I am not suggesting that Python should behave like Q in this respect, just
showing that this particular wart is not present in all languages.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140308/ce74a2d7/attachment.html>
More information about the Python-ideas
mailing list