[Numpy-discussion] What is the sign of nan?

Charles R Harris charlesr.harris at gmail.com
Tue Sep 30 02:25:48 EDT 2008


On Mon, Sep 29, 2008 at 11:56 PM, David Cournapeau <
david at ar.media.kyoto-u.ac.jp> wrote:

> Nathan Bell wrote:
> >
> > +1 for NaN-always-propagates since we have explicit variants for the
> > alternative semantics.
> >
> > Users are more likely to remember that "NaNs always propagate" than
> > "as stated in the C99 standard...".
>
> I don't know. I would like to agree with you, but OTOH, starting to go
> against the C99 standard may bring us quite far. FWIW, matlab has the
> same behavior as mandated by C99 (but not R, by default).
>
> The problem I have with fmax is that:
>    - isgreaterequal may be slow ? May well be red-herring.


For gcc, isgreaterequal should be the same as >= the way numpy is set up
now, i.e., no errors raised. Looking at the assembly it all looked pretty
clean with both numbers stored in the FPU. What I couldn't figure is why
every compare needed to be done afresh, i.e. a > b and a == b had to run two
compares, this on variables declared constant. I'm kind of inclined to
follow the C standard as I figure there is already a lot of discussion
behind it and it would be kind of a waste to hash it all out again on this
list.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080930/8475a246/attachment.html>


More information about the NumPy-Discussion mailing list