|
Re: Simple question about the '>' sign. [message #69688 is a reply to message #69687] |
Tue, 02 February 2010 20:52  |
munka
Messages: 36 Registered: December 2009
|
Member |
|
|
On Feb 2, 9:23 am, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> In article <MPG.25d10b8422472a4a989...@news.giganews.com>,
> David Fanning <n...@dfanning.com> wrote:
>
>
>
>
>
>> R.G. Stockwell writes:
>
>>> actually, it could force Y to be a float array, rather than an int array.
>>> (if a and b are ints)
>
>>> IDL> help,( b - a*6) > 0
>>> <Expression> INT = Array[10]
>>> IDL> help,( b - a*6) > 0.
>>> <Expression> FLOAT = Array[10]
>
>> Next time, I'm going to read the damn question before
>> I answer it. :-(
>
>> Cheers,
>
>> David
>
> RTFQ, then tell them to RTFM. :-)
>
> Cheers, Ken
Well. I have to admit, I don't actually have IDL installed on my home
computer, where I sent the question from. I only have it installed on
the computer that I work on, which is in the office. I looked up the
symbols, and I realized that I know very little about the crazy
symbols IDL has. They're not too complex, I just haven't had any
experience with them. (except for ?... that one still confuses me)
Thanks for the responses!
~Bill
|
|
|
Re: Simple question about the '>' sign. [message #69692 is a reply to message #69688] |
Tue, 02 February 2010 07:23  |
Kenneth P. Bowman
Messages: 585 Registered: May 2000
|
Senior Member |
|
|
In article <MPG.25d10b8422472a4a9896a4@news.giganews.com>,
David Fanning <news@dfanning.com> wrote:
> R.G. Stockwell writes:
>
>> actually, it could force Y to be a float array, rather than an int array.
>> (if a and b are ints)
>>
>> IDL> help,( b - a*6) > 0
>> <Expression> INT = Array[10]
>> IDL> help,( b - a*6) > 0.
>> <Expression> FLOAT = Array[10]
>
> Next time, I'm going to read the damn question before
> I answer it. :-(
>
> Cheers,
>
> David
RTFQ, then tell them to RTFM. :-)
Cheers, Ken
|
|
|
Re: Simple question about the '>' sign. [message #69697 is a reply to message #69692] |
Mon, 01 February 2010 15:02  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
R.G. Stockwell writes:
> actually, it could force Y to be a float array, rather than an int array.
> (if a and b are ints)
>
> IDL> help,( b - a*6) > 0
> <Expression> INT = Array[10]
> IDL> help,( b - a*6) > 0.
> <Expression> FLOAT = Array[10]
Next time, I'm going to read the damn question before
I answer it. :-(
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
|
|
|
Re: Simple question about the '>' sign. [message #69698 is a reply to message #69697] |
Mon, 01 February 2010 14:55  |
R.G.Stockwell
Messages: 163 Registered: October 2004
|
Senior Member |
|
|
> munka writes:
>
>> I came across this line:
>>
>> Y=( B - A*6)>0.
>>
>> is this equal to:
>>
>> Y=B - A*6
>> index=where( Y lt 0., ct)
>> if ct ne 0 then Y[index]=0.
>
> No, this is the "greater than" operator. It compares
> the two values on either side of the operator and returns
> the largest of the two.
>
>> Also, is the decimal point after the 0 significant?
actually, it could force Y to be a float array, rather than an int array.
(if a and b are ints)
IDL> help,( b - a*6) > 0
<Expression> INT = Array[10]
IDL> help,( b - a*6) > 0.
<Expression> FLOAT = Array[10]
|
|
|
Re: Simple question about the '>' sign. [message #69707 is a reply to message #69698] |
Sat, 30 January 2010 16:25  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
wlandsman writes:
> Just to be clear, that is what the 3 lines of code are doing, so the
> answer is yes,
>
> Y = (B-A*6) > 0
>
> is equivalent to
>
> Y=B - A*6
> index=where( Y lt 0., ct)
> if ct ne 0 then Y[index]=0.
Sorry. Didn't really read the code. Tennis, you know. ;-)
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.")
|
|
|
Re: Simple question about the '>' sign. [message #69708 is a reply to message #69707] |
Sat, 30 January 2010 13:39  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Jan 30, 3:38 pm, David Fanning <n...@dfanning.com> wrote:
> munka writes:
>> I came across this line:
>
>> Y=( B - A*6)>0.
>
>> is this equal to:
>
> No, this is the "greater than" operator. It compares
> the two values on either side of the operator and returns
> the largest of the two.
Just to be clear, that is what the 3 lines of code are doing, so the
answer is yes,
Y = (B-A*6) > 0
is equivalent to
Y=B - A*6
index=where( Y lt 0., ct)
if ct ne 0 then Y[index]=0.
Wayne
|
|
|
Re: Simple question about the '>' sign. [message #69709 is a reply to message #69708] |
Sat, 30 January 2010 12:38  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
munka writes:
> I came across this line:
>
> Y=( B - A*6)>0.
>
> is this equal to:
>
> Y=B - A*6
> index=where( Y lt 0., ct)
> if ct ne 0 then Y[index]=0.
No, this is the "greater than" operator. It compares
the two values on either side of the operator and returns
the largest of the two.
> Also, is the decimal point after the 0 significant?
No.
> It would help if
> I could find somewhere that listed all of the symbols. I think I
> found it once,when I had to figure out what the "~" did.... i just
> remember looking for a long time to try to figure out what that symbol
> meant. It is not blatantly obvious, and everything I google doesn't
> come up with the right answers :(
If you use the Index tab of the IDL on-line help and type
a greater than symbol into the Search box, this operator is
the first to appear.
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.")
|
|
|