[Python-Dev] FP vs. tutorial

Tim Peters tim.one@home.com
Tue, 22 May 2001 00:02:18 -0400


[Mark Hammond, on http://www.lahey.com/float.htm]

> I quite liked the tone of this note.  The Python-dev morons probably could
> make good sense of this, but only due to the relentless persistence of a
> certain timbot.
>
> If not for Tim, I would have forgotten completely about binary floating
> point versus decimal floating point.  IIRC, me and about 40 other guys
> were desperately trying to get the attention of the single CS female on
> the day that lecture was given.  (Actually, that is a pretty safe bet -
> _all_ lectures were spent that way :)

I remember guys like you.  Well guess what?  You ended up with a baby, while
I'm known on two continents as the author of tabnanny.py.  Ha!  Revenge is a
dish best eaten cold <burp>.

> However, without a little additional background I doubt the masses would
> be able to get too far into this.

There's only so much you can say to unmotivated people who are also unwilling
to learn.  That's not my problem.  Finding them a gentle intro from which
they *could* learn isn't either, but typing a URL is easy enough that I don't
mind.

Here:  I want to script MS Word with Python.  I don't know COM and refuse to
learn anything about it.  I'd rather not install win32all either, and import
statements confuse me.  Why don't you make it easy for me?  It's the same
thing -- you can point them at what they need to learn if they're serious,
else they're simply out of luck.

[And on]
>> http://www.python.org/cgi-bin/moinmoin/RepresentationError
>
> IMO, this is a little worse.

In one sense it's much worse:  it's only trying to explain a single cause of
fp surprises.  OTOH, it explains it precisely while giving the reader the
tools needed to do an exact analysis of any case of that particular class.
The Lahey link touches on all the common sources of surprises, but leaves
them fuzzy.

> There is less "background".  Eg, in almost the first paragraph we see:
>
> """
> Rewriting
>     1        J
>    ---  ~= ----
>    10      2**N
> """
>
> And I went "huh?  Where did j and N spring from?".  Reading a bit further
> made it clear, but this document did seem a little impenetrable to
> floating point or maths newbies.

It did its job for them if it simply scared them <0.5 wink>.

> It seems to me that the RepresentationError document was written for
> people with a decent background in maths -

There's nothing more complicated than integer division there.

> exactly the sort of people who _don't_ need such a document.

They actually do:  regardless of math background, nothing about f.p. is
obvious before studying f.p. as a subject in its own right.  It's "not like"
anything else, and in previous lives I spent a good chunk of my work time
explaining the same stuff to doctorates.  Mathematicians were actually the
hardest audience at first, perhaps because they had the hardest time
admitting they didn't already understand it; after getting beyond bruised
professional pride, though, they were the easiest audience to bring up to
speed.