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

Home » Public Forums » archive » HELP with IF statement
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: HELP with IF statement [message #91277 is a reply to message #91271] Thu, 25 June 2015 08:20 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
On 06/25/15 08:22, David Fanning wrote:
> g.nacarts@gmail.com writes:
>
>> I have a problem with IF statement
>>
>> I wanted to check whether my array A has any zero element and if
>> so then simply return a zero array (with two zeroes). I typed the
>> following but am not sure if it's correct.
>>
>> A FLOAT = Array[58]
>>
>> FOR i=0L, 57 DO BEGIN
>> IF A[i] EQ 0 THEN RETURN, [0,0]
>> ENDFOR
>
> There are a whole host of articles on my web page explaining why it will
> be impossible to find a zero value in an array of floats. I'll just give
> you the bottom line: use Floats_Equal from the Coyote Library to do this
> kind of comparison:
>
> IF Floats_Equal(a[i],0) THEN RETURN, [0,0]

Yes. My first reply when I am asked this sort of question is: "What do
you think is zero?"

Or, if I'm feeling particularly obtuse: "What IS zero?" (with a suitable
gesticulatory flourish, of course :o)

Funny, now that I think about it, people haven't come to ask me
questions for a while now. Huh.

cheers,

paulv
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: BYTSCL function
Next Topic: IDL Site Issues

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

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

Total time taken to generate the page: 0.00461 seconds