[Numpy-discussion] Community Poll: numarray default underflow handling == "ignore" ?

David M. Cooke cookedm at physics.mcmaster.ca
Fri Nov 21 11:13:03 CST 2003

On Fri, Nov 21, 2003 at 08:50:42AM -0800, Chris Barker wrote:
> Todd Miller wrote:
> > > > Someone recently suggested that we change the default for numarray
> > > > underflow checking to "ignore".  Please  vote (+1, 0, -1):
> > The default of underflow is "warn"
> assuming that ignore means that zero will be used, I vote +1
> If the difference between zero and the smallest floating point number is
> significant in your app, you'd better know what you're doing with
> floating point, and you should then know to set the check to "warn" or
> "raise".

Agree, +1. It's quite common (for me) that I want exp(-1000) to give 0,
and not an error (or warning, espicially in a loop that goes for several
thousand iterations...) Overflow, yes, that's a problem, but not underflow.

(The behaviour below lead me to writing my own exp ufunc for Numeric:
>>> import Numeric
>>> Numeric.exp(-1000)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
OverflowError: math range error

|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca

More information about the Numpy-discussion mailing list