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

Sebastian Haase haase at msg.ucsf.edu
Fri Nov 21 12:23:02 EST 2003


My vote would be '-1' ( if that means "I prefer ignore")
I'm thinking of an INTERACTIVE platform - and so it would just "look nicer"
without to many warnings.

Actually on that note: I read some time ago about pythons default for
printing floats:
>>> 0.1
0.10000000000000001
>>> print 0.1
0.1
>>> repr(0.1)
'0.10000000000000001'
>>> str(.1)
'0.1'

Does anyone here have an update on that ?
What I am especially interested in is when I have a list of (floating point)
(x,y) positions and
then typing in the var-name and getting all these ugly numbers is still very
frustration for me ;-)

Thanks,
Sebastian Haase


----- Original Message ----- 
From: "David M. Cooke" <cookedm at physics.mcmaster.ca>
To: "numpy-discussion" <numpy-discussion at lists.sourceforge.net>
Sent: Friday, November 21, 2003 11:11 AM
Subject: Re: [Numpy-discussion] Community Poll: numarray default underflow
handling == "ignore" ?


> 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
> >>>
> ugh.
> )
>
> -- 
> |>|\/|<
>
/--------------------------------------------------------------------------\
> |David M. Cooke
http://arbutus.physics.mcmaster.ca/dmc/
> |cookedm at physics.mcmaster.ca
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive?  Does it
> help you create better code?  SHARE THE LOVE, and help us help
> YOU!  Click Here: http://sourceforge.net/donate/
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>





More information about the NumPy-Discussion mailing list