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 DocumentRight 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 DocumentRight 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
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.

This note was uploaded on 04/27/2008 for the course PGE 310f taught by Professor Srinivasan during the Spring '08 term at University of Texas at Austin.

Page1 / 11

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

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online