{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture-19(operations-loops)

Lecture-19(operations-loops) - Computations and Loops...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Computations and Loops
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Operations The following operators are available Addition + Subtraction - Multiplication * Division / Exponentiation ^ The following are the operator precedence rules First priority - Parenthesis ( ) Second Priority – Exponentiation ^ Third Priority – Negation – Fourth Priority – Multiplication/Division *,/ Fifth Priority – Addition/Subtraction +,-
Background image of page 2
Examples of Computations z = - 2 ^ 2 The exponentiation is higher priority so it will be executed first - 2 ^ 2 = 4 Next is the negation – Answer = -4 However, Excel works differently. In EXCEL, negation has higher priority than exponentiation. Hence : First execution – (-2) Second execution – (-2)^2 - Answer = 4 Can you write down how the expression will be execute in VBA and in EXCEL corresponding to x = -2? 2 x e y - =
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Operator Rules In choosing between two operations with equal priority, the evaluation of an expression occurs from left to right Supposing we have an expression V = A/D*B^C+D*E The evaluation starts from the left (= sign).
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.
  • Spring '08
  • Srinivasan
  • Inverse function, Inverse trigonometric functions, higher priority, First Priority, Priority ­ Exponentiation

{[ snackBarMessage ]}