[Numpy-discussion] Numeric Underflow Exceptions: Recommendations?

Frank Horowitz frank.horowitz at csiro.au
Mon Oct 18 23:33:03 CDT 2004


Hi all,

Using Numeric 23.5 I've been bitten by the dreaded 'floating point
underflow throws an "OverflowError: math range error" instead of
silently returning zero' bug.

My setup is Debian unstable (Sid) on an i386, and I am using Debian's
binary package "python-numeric".

I understand from googling past discussions that this is (used to be?)
phase-of-the-moon stuff, depending mostly upon architecture, options at
libm compilation time of libc6. Several references to a trick of adding
"-lieee" to the link list succeeding in taming the bug were mentioned
around the era of Python2.0. 

My questions are these: Is there some higher level way of dealing with
underflow now in Numeric? Or am I going to have to track down wherever
"-lieee" has disappeared to in Debian, and recompile Numeric in the
hopes that that still cures the problem?

Any other tricks up people's sleeves for dealing with this? (I already
know about exp_safe in Fernando Perez' IPython/numutils.py, BTW. I'm
kind of hoping for a library level fix though, since my code is littered
with "Numeric.exp()" calls.)

TIA for any help you might be able to provide!

Cheers,

	Frank Horowitz









More information about the Numpy-discussion mailing list