comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Filtering out NaNs
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Filtering out NaNs [message #8633 is a reply to message #8528] Sun, 23 March 1997 00:00 Go to previous messageGo to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
Stein Vidar Hagfors Haugan <steinhh@rigil.uio.no> wrote in
article <5gp9oq$8hp$1@ratatosk.uio.no>...
>
> NaNs are characterized by the fact that they are *not* equal
> to any number (that's what it says, isn't it :-)
>
> In fact, it's not even equal to itself - and this is the distinguishing
> feature that must be used to pick them out. I.e.,
>
> a(where(a ne a)) = missing_flag

I've always used the finite function, eg:

a(where(1-finite(a))) = missing_flag

However FINITE returns 0 for infinities as well as NaNs and I suppose this
could be a problem in some instances.

I just tried 4 different comparison operators against pairs of NaN's and
found that on my system (IDL 5.0 prerelease on WinNT/Intel) NaN IS equal to
itself, but it's also greater than itself.

IDL> a = !values.f_nan
IDL> print, a eq a, a ne a, a gt a, a lt a
1 0 1 0
% Program caused arithmetic error: Floating illegal operand

Curious.

============================================================ ==
Mark Hadfield NIWA (Taihoro Nukurangi)
PO Box 14-901
m.hadfield@niwa.cri.nz Wellington, New Zealand
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: RSI and the 24. Tagname...
Next Topic: ANY LINUX IDL USERS?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 19:25:18 PDT 2025

Total time taken to generate the page: 0.47953 seconds