Old Man Yells At Cloud

Chris Angelico rosuav at gmail.com
Tue Sep 19 16:34:39 EDT 2017


On Wed, Sep 20, 2017 at 5:45 AM, Stefan Ram <ram at zedat.fu-berlin.de> wrote:
> Chris Angelico <rosuav at gmail.com> writes:
>>On Wed, Sep 20, 2017 at 4:59 AM, Stefan Ram <ram at zedat.fu-berlin.de> wrote:
>>>I don't get this. For example, the contractual payment (cost) is
>>>47.21
>>>, the other party hands over
>>>50.25
>>>. Now I am supposed to add /what/ to the cost?
>>Start at the smallest end. You need to make 21 cents up to 25. So hand
>>back four pennies.
>
>   Yes, but to know this ("four") I have to do a /subtraction/:
>
>       25 - 21 = 4.
>
>   And Jan wrote that he is amazed seeing people /subtract/,
>   when all they'd need to do was /add/.
>
>>* Build 21 cents up to 25. Two 2c coins: "23, 25"
> ...
>>Does that make sense?
>
>   Ok, yes. This seems to be an implementation of subtraction
>   by "stepwise addition".

Yeah. Not even "stepwise" addition, in many cases - just counting.
Grab a handful of 1c coins, and say the bill value first, then start
counting coins. By the time you hit 25, you've handed over the right
number of coins (four). When working with any denomination that's a
multiple of ten, it's that simple.

ChrisA



More information about the Python-list mailing list