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

Home » Public Forums » archive » Re: array handling
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: array handling [message #52113] Mon, 08 January 2007 09:43 Go to previous message
news.qwest.net is currently offline  news.qwest.net
Messages: 137
Registered: September 2005
Senior Member
"Brian Larsen" <balarsen@gmail.com> wrote in message
news:1168100109.828745.131590@11g2000cwr.googlegroups.com...
> Something I have always wondered is the difference between using
> finite() and just using ne?
>
> As an example:
> IDL> array = [ 1.0, 2.0, !Values.F_NAN, 4.0, !Values.F_NAN ]
> IDL> Print, Where( NOT Float( Finite(array) ) )
> 2 4
> IDL> print, where(array ne array)
> 2 4
>
> What is the fundamental difference here? Speed? Style? or something
> else entirely?
>
> Cheers,
>
> Brian

while where(array ne array) is clever, short, and possibly fast
one should note (from IDL help):
"On Windows, using relational operators such as EQ and NE
with the values infinity or NaN (Not a Number) causes an "illegal operand"
error"

Programmers will generally avoid depending on a result that flags an error,
and is not strictly defined in the language. The results may change in
different versions
of IDL, and perahps on different operating systems. Who knows, in version 7,
IDL may
decide to make nan eq nan return 1.


Cheers,
bob
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Recorrido a Espa�a
Next Topic: Re: Recorrido a España

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

Current Time: Wed Oct 08 15:51:59 PDT 2025

Total time taken to generate the page: 0.00385 seconds