[Python-Dev] FP vs. tutorial

Tim Peters tim@digicool.com
Tue, 22 May 2001 00:58:21 -0400


[Michel Pelletier, on http://www.lahey.com/float.htm]
> I liked the tone too, but it really goes into a lot of detail, there's
> this problem, and that one, oh and also *this* one and then there's
> *that* and the other thing, and after a while you get the impression
> that floating-point is for the insane.

Using an unfamiliar power tool with sharp edges, and while blindfolded, is
insane.

[and on http://www.python.org/cgi-bin/moinmoin/RepresentationError]

> I agree.  Equations should not be needed to explain this.

There's exactly one equation on that page, saying that one ratio of two
integers is approximately equal to another ratio of two integers.  If that's
too much for you, and you weren't satisfied with the *initial* hand-wavy
explanation ("1/10 is not exactly representable as a binary fraction")
either, then it's up to you to do better than the latter without actually
saying anything useful <wink>:

Q:  Why is Python broken:

    >>> 0.1
    0.10000000000000001

A:  [your turn]