addition algorithm
DESCRIPTION
Addition AlgorithmTRANSCRIPT
Algorithms for Integer Algorithms for Integer ArithmeticArithmetic
Algorithms for Integer Algorithms for Integer ArithmeticArithmeticAddition AlgorithmAddition Algorithm
Three Steps to Adding Two Integers
STEP 1. Do they have the same sign?(both positive or both negative)
orDo they have opposite signs? (one positive and the other negative)
Same Signs
9 11 20, ( 3) ( 17) 20
9 11 ?, ( 3) ( 17) ?
STEP 3. Now enter the sum of the absolute values: (add the magnitudes)
STEP 2. Enter the common sign:
9 11 , ( 3) (20 21 07)
Opposite Signs
17 3 14
3 ( 17) ?
STEP 3. Enter the difference of the larger magnitude and the smaller:
STEP 2. Enter the sign of the number having the larger magnitude:
3 ( 17 14)
3 ( 17) 14
Work it out!
12 ( 34 22)
Step 1
12 ( 34 22)
They have opposite signs.
Same or opposite signs?
Step 2
12 ( 34 22)
Enter the sign of the number having the larger magnitude:
|-34| = 34 > 12 = |12|
Step 3
12 ( 34) 22
Subtract the smaller magnitude from the larger and enter the result.
Work it out!
29 114 5
Step 1
29 14 29 ( 14)
They have opposite signs.
Same or opposite signs?
Step 2
29 114 5
Enter the sign of the number having the larger magnitude:
|29| = 29 > 14 = |-14|
Step 3
29 14 15
Subtract the smaller magnitude from the larger and enter the result.
Work it out!
12 14 6
Step 1
12 14 6
They are both positive.
Same or opposite signs?
Step 2
12 14 6
The sign is positive.
Step 3
12 4 16
Add the magnitudes and enter the result.
Work it out!
( 2) ( 119)
Step 1
( 2) ( 119)
They are both negative.
Same or opposite signs?
Step 2
( 2) ( 119)
The sign is negative.
Step 3
( 2) ( 9) 11
Add the magnitudes and enter the result.
Adding Many Integers
2 8 7 3 2 ( 8) 7 ( 3)
1. Add all the positive numbers and add all the negative numbers:
2 7 9 , ( 8) ( 3) 11
2. Add the two signed numbers:9 ( 11) 2Answer.
12 14 6
Work it out!
12 4 16
Work it out!
16( 12) 4
Work it out!
( 12) 4 16
Work it out!
(2 4 1) (( 5) ( 3))
7
2 4 ( 5) ( 3
)
) 1
( 8 1
Work it out!
2 4 ( 5) ( 3) 1
(2 4 1) ((
7 (
5) ( 3))
8) 1
Work it out!
2 4 ( 5) ( 3) 1
(2 4 1) (( 5) ( 3))
7 ( 18)
Work it out!
2 4 ( 5) ( 3) 1
(2 4 1) (( 5) ( 3))
7 ( 8) 1
Work it out!
9 2 4 (4 1 3)
15 8
4 2
7
9 1 4 3
Work it out!
9 4 2 1 4 3
9 2 4 (
15
4 1 3)
8 7
Work it out!
9 4 2 1 4 3
9 2 4 (4 1 3)
15 78
Work it out!
9 4 2 1 4 3
9 2 4 (4 1 3)
15 8 7
Work it out!
12.7 1.3 5.0
12.7 1.3 1
(15.6
5.6 5.0 3.4
3.4)
19.0 19.0 0
Work it out!
12.7 1.3 15.6 5.0 3.4
12.7 1.3 5.0 (15.6 3.4)
19.0 19.0 0
Work it out!
12.7 1.3 15.6 5.0 3.4
12.7 1.3 5.0 (15.6 3.4)
19.0 1 09.0
Work it out!
12.7 1.3 15.6 5.0 3.4
12.7 1.3 5.0 (15.6 3.4)
19.0 19.0 0
Work it out!
Work it out!
100 7
2 5 7 3
2 5 7
4 6
4
1
3 6
7
Rigid use of an algorithm is not always best.
Work it out!
100 7
2 5 7 3 4 6
2 7 13 75 4 6
Work it out!
100 7
2 5 7 3 4 6
2 5 7 3 4 6 17
Moral
Look before you leap!
Many problems can be worked in your head if you do things in the right order.
2 5 7 3 4 6 17