[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: where() and IEEE NaN



badastro@smart.net (Philip Plait) writes:

> In article <7vv1j3$6ro$1@ra.nrl.navy.mil>,
> Todd Bowers <tbowers@nrlssc.navy.mil> wrote:
> >IDL> a = [1,2,!Values.F_NaN,4,!Values.F_NaN]
> >IDL> print, a
> >      1.00000      2.00000          NaN      4.00000          NaN
> >IDL> print, where(a EQ !Values.F_NaN)
> >           0           1           2           3           4
> >
> >Hmmmmmm.... is this a known feature? The where() help says
> >nothin' about NaN's.
> >IDL v5.2a

>Incidentally, if you are looking for the element numbers
>of where a = NaN, try:

>IDL> print,where(a-a ne 0)
>           2           4


Isn't it simpler (and faster) to say

	IDL> print,where(a ne a)

William Thompson