{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture-19(operations-loops)

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

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

Computations and Loops

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

View Full Document
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 +,-
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 - =

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

View Full Document
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).
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 ]}