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

Home » Public Forums » archive » Re: Relational Operators on Windows
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: Relational Operators on Windows [message #71564 is a reply to message #71563] Fri, 25 June 2010 18:45 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
wlandsman writes:

>
> Sometimes as shortcut for explicitly testing for NaN values, I use the
> fact that NaN is never less than, equal to, or more than a numeric
> value. So if I need to get the values less than 3 in the following
> array
>
> a = [3.2, !VALUES.F_NAN, 2]
>
> I simply say
>
> a = a [ where(a lt 3) ]
>
> and the NaN values are excluded along with the values larger than
> 3. This works fine on Linux and Mac OSX. But someone pointed me
> to the IDL help on relational operators which says,
>
> "On the Windows platform, using relational operators with the values
> infinity or NaN (Not a Number) causes an "illegal operand" error."
>
> Unfortunately, neither of us has access to a Windows machine. Does
> one really get an "illegal operand" value on Windows with the above
> code (so that I need to use the FINITE() function)? Thanks, --Wayne

Yes. :-)

IDL> a = [3.2, !VALUES.F_NAN, 2]
IDL> a = a [ where(a lt 3) ]
% Program caused arithmetic error: Floating illegal operand
IDL> print, a
2.00000

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Multi-Array comparison
Next Topic: Re: Add GSHHS coastline on georeferenced image layers retrieved from MODIS HDF file?

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

Current Time: Sat Oct 11 14:32:12 PDT 2025

Total time taken to generate the page: 1.91941 seconds