AOIT Introduction to Programming Unit 2, Lesson 6 Arithmetic Operators and Operator Precedence Copyright © 2009–2012 National Academy Foundation. All rights.

Slides:



Advertisements
Similar presentations
Copyright 2012, 2008, 2004, 2000 Pearson Education, Inc.
Advertisements

PERFORMING CALCULATIONS IN SCIENTIFIC NOTATION
1 C Fundamentals - I Math 130 Lecture # 2 B Smith: Sp05: With discussion on labs, this took 53 minutes. Score 3. Many caveats. B Smith: Sp05: With discussion.
OBJECTIVES 1.9 Exponential Notation and Order of Operations Slide 1Copyright 2012, 2008, 2004, 2000 Pearson Education, Inc. aWrite exponential notation.
CHAPTER 9 Introduction to Real Numbers and Algebraic Expressions Slide 2Copyright 2012, 2008, 2004, 2000 Pearson Education, Inc. 9.1Introduction to Algebra.
Types and Arithmetic Operators
Objective A: To Evaluate Exponential Expressions
©2004 Brooks/Cole Chapter 2 Variables, Values and Operations.
1 Expressions, Operators Expressions Operators and Precedence Reading for this class: L&L, 2.4.
Exponent Rules – Day 1 Zero and Negative Exponents.
Numerical Expressions
PERFORMING CALCULATIONS IN SCIENTIFIC NOTATION
Copyright © Cengage Learning. All rights reserved. 0 Precalculus Review.
4-1 6 th grade math Exponents. Objective To write and evaluate exponential expressions Why? To prepare you for higher learning in math and science. To.
2 pt 3 pt 4 pt 5pt 1 pt 2 pt 3 pt 4 pt 5 pt 1 pt 2pt 3 pt 4pt 5 pt 1pt 2pt 3 pt 4 pt 5 pt 1 pt 2 pt 3 pt 4pt 5 pt 1pt Prime Factorization Factors & Divisibility.
Copyright 2013, 2009, 2005, 2002 Pearson, Education, Inc.
Bell Ringer = – 5 = = ÷ -2 = =6. -7 – (-7) = After you have completed the bell ringer, take out your homework!
HAWKES LEARNING SYSTEMS Students Matter. Success Counts. Copyright © 2013 by Hawkes Learning Systems/Quant Systems, Inc. All rights reserved. Section 1.8.
ORDER OF OPERATIONS x 2 Evaluate the following arithmetic expression: x 2 Each student interpreted the problem differently, resulting in.
Objective 1.To write very large or very small numbers in standard form, in scientific notation, and vice versa. To compare and order numbers in scientific.
Chapter 4 Techniques of Differentiation Sections 4.1, 4.2, and 4.3.
Operators in Python. Arithmetic operators Some operators in Python will look familiar (+, -, *, /) Others are new to you (%, //, **) All of these do work.
Welcome to Math 6 ORDER OF OPERATIONS. OBJECTIVE: Each student will understand and use the order of operations.
1-2 Order of Operations and Evaluating Expressions.
Evaluating Integer Expressions Friday, December 25, 2015.
Doing math In java.
Order of Operations with Integers
Copyright © 2014, 2010, and 2006 Pearson Education, Inc. Chapter 1 Introduction to Algebraic Expressions.
Write as an Algebraic Expression The product of a number and 6 added to a.
HAWKES LEARNING SYSTEMS Students Matter. Success Counts. Copyright © 2013 by Hawkes Learning Systems/Quant Systems, Inc. All rights reserved. Section 7.5.
CSCI 1100/1202 January 18, Arithmetic Expressions An expression is a combination of operators and operands Arithmetic expressions compute numeric.
ORDER OF OPERATIONS LESSON 2.
Notes 2.1 Order of Operations PEMDAS If an expression has only numbers and symbols, it is a numerical expression. If it has a variable it is a variable.
PERFORMING CALCULATIONS IN SCIENTIFIC NOTATION ADDITION AND SUBTRACTION.
Chapter P Prerequisites: Fundamental Concepts of Algebra Copyright © 2014, 2010, 2007 Pearson Education, Inc. 1 P.2 Exponents and Scientific Notation.
CHAPTER 1 Whole Numbers Slide 2Copyright 2011 Pearson Education, Inc. 1.1Standard Notation 1.2Addition 1.3Subtraction 1.4Multiplication 1.5Division 1.6Rounding.
1Object-Oriented Program Development Using C++ Built-in Data Types Data type –Range of values –Set of operations on those values Literal: refers to acceptable.
Order of Operations ~ Use Order of Operations.
CHAPTER 12 Polynomials: Operations Slide 2Copyright 2012, 2008, 2004, 2000 Pearson Education, Inc. 12.1Integers as Exponents 12.2Exponents and Scientific.
Exponents and Order of Operations
Subtracting Integers #41.
Order of Operation Must follow special set of rules to solve
PERFORMING CALCULATIONS IN SCIENTIFIC NOTATION
Scientific Notation.
1 Introduction to Algebra: Integers.
Objective The student will be able to:
Quantitative Measurements
Objective The student will be able to:
Scientific Notation Learning Goal The student will be able to:
Arithmetic Operators Topics Arithmetic Operators Operator Precedence
Express the following rule in function notation: “subtract 4, then divide by 5”. Select the correct answer: {image}
For what number is 23 x 32 x 7 the prime factorization?
Adding and Subtracting Numbers in Scientific Notation
Equivalent Linear Expressions
SCIENTIFIC NOTATION.
Arithmetic Operators Topics Arithmetic Operators Operator Precedence
Rules for Determining Significant Figures
Sec 1.1 – Order of Operations
Lesson 3: Complex Formulas
The Order of Operations Unit 1 Lesson 3
Order of Operations PEMDAS.
PERFORMING CALCULATIONS IN SCIENTIFIC NOTATION
Number Lines.
Arithmetic Operators Topics Arithmetic Operators Operator Precedence
7-4 Division Properties of Exponents
PERFORMING CALCULATIONS IN SCIENTIFIC NOTATION
43 Order of Operations  ( ) + - X.
Algebra 1 Section 1.8.
What do you think it means? Before:
Presentation transcript:

AOIT Introduction to Programming Unit 2, Lesson 6 Arithmetic Operators and Operator Precedence Copyright © 2009–2012 National Academy Foundation. All rights reserved.

Python uses common arithmetic operators with integers OperatorSymbolExampleEvaluates To... Addition+3+25 Subtraction-3-2 Multiplication*3*2 Division/2/3 Exponentiation**3**2 Remainder (modulo) %27%5 What do you think each example evaluates to? Note: This last example calculates the remainder left after 27 is divided by 5.

Python uses the same operators with floating point OperatorSymbolExampleEvaluates To... Addition Subtraction Multiplication*3.0*2.0 Division/2.0/3.0 Exponentiation**3.0**2.0 Remainder (modulo) %27.0%5.0 What do you think each example evaluates to?

Special notation is used for large floating-point numbers If a floating-point calculation gets large enough, the result is returned in exponential notation: 2.0**100= e+30 In scientific notation this would be: x10^30

Python observes operator precedence rules By default Python evaluates operations in the same order used in arithmetic: 1. Parentheses (used to group operations in expressions) 2. Exponentiation 3. Multiplication 4. Division (and Remainder) 5. Addition 6. Subtraction This is sometimes called the PEMDAS rule. Do you see why? (evaluated at the same level, left to right) (multiple instances are evaluated right to left)

Here are some PEMDAS examples / 3.0 = ** = 18 2 ** (3 + 10) = 8192 Which operation was done first?

In expressions with multiple operations, it’s better to use parentheses to ensure the result you want 2 * / 2 = ??? (2 * (6 - 4)) / 2 = ??? What is the answer?

Operators are the building blocks of Python expressions Operators are used in virtually all numeric expressions. The PEMDAS rule tells you how Python will evaluate arithmetic expressions by default. To be sure Python evaluates your expressions in the way you intend, use parentheses to isolate operations.