What is considered an "advanced" topic in Python?

BartC bc at freeuk.com
Mon Jun 1 11:42:50 EDT 2015


On 01/06/2015 16:07, Laura Creighton wrote:
> In a message of Mon, 01 Jun 2015 14:57:02 +0300, Marko Rauhamaa writes:
>> In 1951, decimal numbers would have done little good in the UK with the
>> pound divided into 20 shillings and the shilling into 12 pence. Maybe a
>> "Babylonian" module would have been perfect.
>>
>>
>> Marko
>
> You are being facetious, but in point of fact, naive Brits who knew nothing
> of neither accounting systems nor floating point for the most part got
> things right when they bought their Sinclair computer in the early
> 1980s.
>
> This is because their natural tendancy was to calculate all the pounds
> separately, and then the shillings, separately, and then the pence.

Strangely I don't remember that. Although we did have to add up sums of 
money in three columns: pounds, shillings and pence, and carried as 
necessary from right to left.

> (With Guineas and other odd stuff thrown in, when the needed them).
> This meant that they kept 3+ legers at one time, and then, when they
> were done calculating as one final step converted what they had into
> its representation where you never had more than 100 pence or 12 shillings.

You mean 12 pence or 20 shillings?

> Thus, entirely by accident, they did their accounting in integers, not
> decimals at all.

> And this is, of course, the first thing that people who write real
> systems that add money learn -- convert everything to pennies (or
> whatever you call them) and do all your calculations in pennies, and
> then as the final step express that in dollars and cents, or euros
> and cents, or what have you.

When decimal currency came in, we had decimals *and* fractions! Because 
of the 1/2p coin. So this didn't quite work.

But it can work now, so we have no need of either binary or decimal 
floating point.

(Well, until you have to work in dual currencies which can mean that an 
amount of money that is exact in one currency, can only be approximate 
in the other, when both are expressed in the smallest currency unit - 
cent, penny or whatever.)

> The Brits still got in trouble when they needed to calculate things for their
> 4.2 per cent morgage, or decided to keep a running total of the sales
> tax they were paying, but they at least did not grab the floating
> number representation as the first thing off the shelf when they needed
> money.

At one time the choice was integer or floating point in many languages, 
unless you were specifically using a business language such as Cobol.

I think the Sinclair computer barely had integer types so the choice was 
even narrower.

-- 
Bartc



More information about the Python-list mailing list