A use for integer quotients

Stephen Horne steve at lurking.demon.co.uk
Mon Jul 23 23:33:54 EDT 2001


I've been getting seriosly ratty - reading what I wrote shows that it
really is time to take that rest Tim suggested.

Sorry for that.

I wish I could afford to just shrug it off and move on - unfortunately
that's not the position I'm in.

There's only one new thing I can probably say, and that is...

On 23 Jul 2001 16:54:43 -0700, Johann Hibschman
<johann at physics.berkeley.edu> wrote:

>> They are *NOT* the right thing from a mathematical point of view -
>> integer division in mathematics gives an integer quotient and integer
>> remainder as any five-year-old knows.
>
>Well, most mathematicians I know would disagree.  Division is not
>well-defined on integers, unless you want "5 / 2" to return "(2, 1)".
>It's just not a property integers have.  Or, well, you can define the
>operation, but they'll stop being a group under it, so all hell breaks
>loose.  :-)
>
>Five year olds don't know much maths.

But 99% of programming arithmetic is at this level, or maybe up to
ten-year-old at best. We don't even do algebra - we do the 'rub out
the x, write in *this* number and then work out the answer' thing
children learn as a prelude to algebra. Professional pride may make
this a hard thing to accept, but mathematics above the ten-year-old
level is rarely needed in programming except in particular
applications tackled by people with specialist knowledge.




More information about the Python-list mailing list