How regrouping (borrowing) works
- Stack the two numbers with their units digits aligned; bigger number on top.
- Start at the right-most column. If the top digit is ≥ the bottom digit, just subtract.
- If the top digit is smaller, borrow 1 from the next column to the left: the top digit gains 10, and the column you borrowed from drops by 1.
- Move one column left and repeat. If the column you need to borrow from is 0, keep going further left until you find a non-zero digit and propagate the borrow back.
columnk: if ak < bk, set ak ← ak + 10 and ak+1 ← ak+1 − 1; then digit = ak − bk
FAQ
What if the subtrahend is bigger than the minuend?
The result is negative. The calculator swaps the operands internally, performs long subtraction, and writes the result with a leading minus sign.
How does borrowing across zeros work?
If you need to borrow from a 0, that 0 turns into 9 and you keep borrowing one column further left. The calculator shows the chain of changes above the column.