[Numpy-discussion] What is the logical value of nan?

Charles R Harris charlesr.harris@gmail....
Tue Mar 10 16:49:15 CDT 2009


On Tue, Mar 10, 2009 at 3:16 PM, Stéfan van der Walt <stefan@sun.ac.za>wrote:

> 2009/3/10 Pauli Virtanen <pav@iki.fi>:
> > Nonzero Python object, hence True. Moreover, it's also True in Python:
>
> Also in C:
>
> #include <math.h>
> #include <stdio.h>
>
> int main() {
>    double nan = sqrt(-1);
>    printf("%f\n", nan);
>    printf("%i\n", bool(nan));
>    return 0;
> }
>
> $ ./nan
> nan
> 1
>

So resolved, it is True.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090310/c7a9cc14/attachment.html 


More information about the Numpy-discussion mailing list