Some Q&A with Kahan on IEEE 754

Glyph Lefkowitz glyph at no.spam
Tue Oct 17 11:54:06 EDT 2000


Huaiyu Zhu <hzhu at rocket.knowledgetrack.com> writes:

> But getting libm to work predictably across platforms is a whole
> other can of worms, above and beyond 754 support.

I don't know about the other posters here, but this seems like a more
important issue to me.  I mean, I would like to write cross-platform
code that works predictably with numbers bigger than 12 and smaller
than 7.  Currently the only way to do that (as far as I can tell) is
to surround every arithmetic operation and cmath call that involves a
user-input variable with a try: except: as WELL as testing for 4
different spellings of NaN and Inf -- and those are only the spellings
I've seen so far.  Maybe maybe MacOS X will spell it "Infinity -- a
very large number" and "Not A Number -- bad input, perhaps?" or
somesuch...

I know that the way that math works is a weighty religious issue to
some folk :) but I don't much care, so long as it works *predictably*.
I'll cheerfully work around whatever warts crop up in extreme cases,
so long it's only _one_ set of warts.

-- 
Glyph Lefkowitz
Professional -- Software Engineer,  Origin Systems
Amateur      -- Computer Scientist, Twisted Matrix Enterprises
(My opinions are my own and do not reflect in any way on the policies
or practices of my employer, etcetera etcetera.)



More information about the Python-list mailing list