PEP-308 a "simplicity-first" alternative

Bengt Richter bokr at oz.net
Sun Feb 16 18:18:06 EST 2003


On Sun, 16 Feb 2003 20:02:26 GMT, Andrew Koenig <ark at research.att.com> wrote:

>>   And Terry meant that if you think that 1.1 is the same as eleven tenths,
>> then you are mistaken.
>
>>   The parallel seems perfectly valid to me.
>
>Indeed, it is -- because 11 is not the same as eleven tenths.
>Here's proof:
>
>    >>> 10 * 11 == 100 * 1.1
>    0
Yeah, and

    >>> 10*11 -2.0**-47 == 100*1.1 -2.0**-47
    1

and the reason you didn't use eleven * tenths more literally, as in

    >>> 11 * .1 == 1.1
    1

is that that had an inconvenient superficial result ;-)
(while really only proving that different terms can have
matching representational errors)

    >>> 11 * .1 ,  1.1
    (1.1000000000000001, 1.1000000000000001)

How's my guessing?
;-)

BTW, the statement "1.1 is the same as eleven tenths" is both true
and false depending on how it is interpreted, which further illustrates
that the English language has usage pitfalls, just as coding idioms may ;-)

Regards,
Bengt Richter




More information about the Python-list mailing list