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 #52123 is a reply to message #52122] Sat, 06 January 2007 08:39 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
Brian Larsen wrote:
> 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?

One thing is that FINITE can handle NaN's and infinity all in one step.

By the way, it took me a second to figure out why you were converting to
float in the FINITE example. Maybe

IDL> print, where(~finite(array))

would be better since FINITE returns only 0's and 1's (as long as you
have IDL 6.0+)?

Mike
--
www.michaelgalloy.com
[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 17:51:52 PDT 2025

Total time taken to generate the page: 0.00442 seconds