Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This explanation has made me realize i can’t remember the last time I tried to substract two four digits numbers without a calculator. I’m not even sure I know how


In case you're serious, just go right to left, digit by digit.

7 - 3 = 4:

       8  4  6  7
    -  4  5  8  3
    -------------
                4

6 is less than 8, so borrow from the next digit. 16 - 8 = 8:

       8  3 16  7
    -  4  5  8  3
    -------------
             8  4
3 is less than 5 so borrow from the next digit. 13 - 5 = 8:

       7 13 16  7
    -  4  5  8  3
    -------------
          8  8  4
7 - 4 = 3:

       7 13 16  7
    -  4  5  8  3
    -------------
       3  8  8  4
And there's the answer!


Interesting cultural differences here: the way I learned it, you increment the next digit of the subtrahend (the lower number) on digit underflow, rather than borrowing from the next digit in the minuend. (So it's rather a carry than borrowing.) Anyways, explicit borrow does for a nice explanation.


That is interesting! I could see that make learning it easier since it's closer to addition if you carry instead of borrow. Though one advantage I see to the borrow is, since you're modifying the minuend, you have room to write the modified value of the digit directly above itself.


If I recall this right (it's been a long time, since), initially we marked the column where the carry went by a dot above the minuend. (I guess, it was the same with addition?)


I guess that’s how I would attempt it if I had to- reverse of addition. Just can’t remember when I have had to. Funny how addition and subtraction are unequally distributed in life




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: