Search This Blog

Friday, February 24, 2012

Integer Subtraction Algorithm

Post your algorithm(s) from 2.2 on subtraction of integers.  Include one for how to solve when both numbers have the same sign and one for how to solve when both numbers have different signs.

16 comments:

  1. The algorithm for negative is you subtract normally. The difference will be negative if the 1st number is larger than the 2nd. The difference will be positive if the 1st number is smaller than the 2nd number.

    +12-+8=-4
    -5-+7=+2
    -4-2=-2

    ReplyDelete
    Replies
    1. There are many more algorithms to consider and add. We discussed positive - positive, negative - positive, positive - negative, and negative - negative. Add what you would do for all those types of problems.

      Delete
    2. Negative&Negative:Take each number and add them together.
      (-8)-(-9)=(-17) 8=9=17
      Positive&Positive: Take each number and add them together
      (+2)-(+6)=(+8) 2+6=8
      Positive&Negative: Take away the signs and add them together and with the biggest number you add the sign on it to the answer.
      (+7)-(-4)=(-11) 7+4=11
      Negative&Positive: Add the numbers together and the biggest number you add the sign on it to the answer.
      (-5)-(+3)=(-8) 5+3=8

      Delete
  2. The algorithm for negative is you subtract normally. The difference will be negative if the 1st number is larger than the 2nd. The difference will be positive if the 1st number is smaller than the 2nd number.

    +9-+7=+2
    -9-+7=-2
    -2--2=-4

    ReplyDelete
    Replies
    1. There are many more algorithms to consider and add. We discussed positive - positive, negative - positive, positive - negative, and negative - negative. Add what you would do for all those types of problems.

      Delete
    2. Negative - Positive ~ Add the 2 numbers together and make the answer a negative
      Negative - Negative ~ Keep the value of the 1st number, make the 2nd number positive and then add them together
      Positive - Negative ~ Drop the Negative on the 2nd sign and add the two number together
      Positive - Positive ~ You subtract normally. The difference will be Positive if the 1st number is larger than the 2nd. The difference will be Negative if the 1st number is smaller than the 2nd number

      Delete
  3. p-p...you take off the negative signs and subtract them

    n-n...you take the 1st number and the 2nd number, and add them

    p-n...take the signs away and add them together

    n-p...take the signs away and the bigger numbers sign

    -phyllis-

    ReplyDelete
    Replies
    1. Might want to double check those. There is one that isn't correct and one that I think you mixed up a sign on. If you have a positive - a positive are there any negative signs to take off? Examples might help you find your error.

      Delete
  4. The algorithm for negative is you subtract normally. The difference will be negative if the 1st number is larger than the 2nd. The difference will be positive if the 1st number is smaller than the 2nd number.

    +9-+7=+2
    -9-+7=-2
    -2--2=-4

    ReplyDelete
    Replies
    1. There are many more algorithms to consider and add. We discussed positive - positive, negative - positive, positive - negative, and negative - negative. Add what you would do for all those types of problems.

      Delete
  5. For positive-positive you take off the negative signs and subtract them.
    For negative-negative you take the 1st number and the 2nd number, and add them.
    For positive-negative you take the signs away and add them together.
    For negative-positive you take the signs away and the bigger numbers sign.

    ReplyDelete
  6. Negative-Negative
    You take the first number and the second number and then you add them
    Positive-Negative
    You take the signs away and add them together.
    Positive-Positive
    you subtract normally
    Negative-Positive
    you take the signs away and the bigger numbers sign on the answer.

    ReplyDelete
  7. Negative - Positive ~ Add the 2 numbers together and make the answer a negative
    Negative - Negative ~ Keep the value of the 1st number, make the 2nd number positive and then add them together
    Positive - Negative ~ Drop the Negative on the 2nd sign and add the two number together
    Positive - Positive ~ You subtract normally. The difference will be Positive if the 1st number is larger than the 2nd. The difference will be Negative if the 1st number is smaller than the 2nd number

    ReplyDelete
  8. P-p just subtract
    P-N Add the numbers
    N-p Subtract or add the numbers together. Answer is negative
    N-N Add numbers together and take the larger numbers sign.

    ReplyDelete
  9. (P- P)-JUST SUBTRACT
    (P- N)-ADD THE #'S
    (N- P)-YOU WOULD ADD OR SUBTRACT THE #'S TOGETHER. THE ANSWER IS NEGATIVE.
    (N- N)-ADD THE #'S TOGETHER AND TAKE THE LARGER #'S SIGN

    ReplyDelete