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

Home » Public Forums » archive » Re: how does it evaluate: y * w # A where:
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: how does it evaluate: y * w # A where: [message #36348 is a reply to message #36347] Mon, 08 September 2003 07:36 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Hassan Iqbal writes:

> Please help me to understand as to how it is being evaluated and what
> do I get from this entire operation:
>
> x= y * w # A
>
> where:
>
> y= an array of 'n' elements
> w= an array of 'n' elements
> A= a matrix of 'n' columns and 'm' rows
>
> which operation is performed first: y*w or w # A

What you want is some notion of operator precedence.
Try this:

IDL> ? operators

Find the "precedence" sub-topic.

You find that the * operator has the third highest
precedence, whereas the # operator has the fourth
highest precedence. Thus, multiplication is done
before matrix operations. If operators have the
same order of precedence, then they are performed
left to right across the expression.

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Fluent data into IDL
Next Topic: A Colored Grid Problem

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

Current Time: Sat Oct 11 22:36:23 PDT 2025

Total time taken to generate the page: 0.31943 seconds