[Patches] fix hashing take#2 (was: fix float_hash and complex_hash for 64-bit *nix)

Guido van Rossum guido@python.org
Sat, 13 May 2000 17:01:21 -0400


> [Trent Mick]
> > ...
> > Just had a thought. I suppose that I should use the
> > PyFPE_{START|END}_PROTECT
> > around the middle block doing the floating point math. Correct?

[Tim]
> No, assuming the platform frexp never blows up (& it shouldn't, but you
> never know what the platform libc does with IEEE oddballs like NaNs and
> infinities), there's nothing in the rest of the code that can possibly blow
> up.  All the operations are well-defined and unexceptional.  The worst that
> can happen is that the IEEE "inexact" flag will get set -- but that happens
> on virtually every fp operation anyway.

I didn't write the PyFPE_ patches, but I believe they were done by
someone whose experience told him *never* to trust that a FP operation
won't raise SIGFPE.  He put them around almost anything that
manipulates floating point.  On the other hand. he left the frexp()
call in mathmodule.c alone.

--Guido van Rossum (home page: http://www.python.org/~guido/)