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

Rob Cliffe rob.cliffe at btinternet.com
Sun Mar 9 13:31:28 CET 2014


On 08/03/2014 18:49, Mark Dickinson wrote:
>
>
> >>> x = 49534541648432951
>
> >>> y = x + 2.0
>
> >>> x < y
>
> True
>
> >>> Decimal(x) > Decimal(repr(y))  # simulating proposed meaning of 
> Decimal(y)
>
> True
>
>
>
You don't need to add 2.0 to x to see this effect.  You can write
     y = float(x)
or even
     y = x - 3.0
and you get the same value for y.

So in fact you can see

 >>> x  <  x - 3.0
True

which might be surprising at first sight.

[Just for amusement :-) ]
Rob Cliffe


More information about the Python-ideas mailing list