Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Why did satirical genius Tom Lehrer swap worldwide fame for obscurity?. Parent comment
----
[What if the digit in the subtrahend is bigger than the one in the minuend?]
Imagine adding 10 to both numbers. Obviously, the difference between them will not be changed.
But adding 10 to the digit in the subtrahend is the same as adding 1 to the digit immediately to its left.
So, add 10 to the [current] digit in the minuend, add 1 to the [next] digit in the subtrahend, and then perform the subtraction.
There are no comments on this comment yet.
----
[What if the digit in the subtrahend is bigger than the one in the minuend?]
Imagine adding 10 to both numbers. Obviously, the difference between them will not be changed.
But adding 10 to the digit in the subtrahend is the same as adding 1 to the digit immediately to its left.
So, add 10 to the [current] digit in the minuend, add 1 to the [next] digit in the subtrahend, and then perform the subtraction.