Module 1: Lecture Notes for Math 170

Return to Lecture Notes page.
Some images on this page have been generated via AsciiMathML.js.
For more information see: www.chapman.edu/~jipsen/asciimath.html.

  1. Order of evaluation: addition, subtraction, multiplication, division
    1. Symbols
      1. + for addition, as in 4+5
      2. - for subtraction, as in 4–5
      3. * for multiplication, as in 4*5 (Note that in math we also use
    2. "My Dear Aunt Sally" to indicate multiplication and division, left to right, followed by addition and subtraction
    3. "Dear Me, So Angry" to point out that multiplication and division are treated as having equal precedence, as are addition and subtraction
    4. Do examples
  2. Include parentheses
    1. Enclosing a part of a computation in parenthesis means that we need to evaluate within the parentheses before evaluating operations next to the parentheses.
    2. Example: (9–4)*(7+12/3)
    3. Again, in math we often use implied multiplication, as in (9–4)(7+12/3), but this is not recognized in most programming languages.
    4. Do examples
  3. Include exponentiation
    1. Exponentiation is raising a base number to a power, as in 4³ to mean 4 to the third power or 4*4*4. In that example, 4 is the base and 3 is the exponent.
    2. The base does not have to be an integer; we can have 3.452²
    3. The exponent does not have to be an integer; we can have
    4. Do examples.

Return to Lecture Notes page.

©Roger M. Palay
Saline, MI 48176
November, 2013