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

Re: where() and IEEE NaN



Todd Bowers (tbowers@nrlssc.navy.mil) writes:

> 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? 

Sure. Well known. :-)

I usually check for NANs like this:

   IDL> Print, Where( NOT Float( Finite(a) ) )    
        2      4 

Cheers,

David

-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155