A use for integer quotients

Johann Hibschman johann at physics.berkeley.edu
Tue Jul 24 01:54:43 CEST 2001


Stephen Horne writes:

>> Anyway, there are two camps.  The proposed new behavior would make my
>> life easier, so I like it.  It's also "the right thing" from a
>> mathematical point of view.  Others clearly disagree.

> 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.

> If you are so keen on int <op> int -> float, why is it *ME* that has
> to change operators and not *YOU*. Is it really just that it makes
> *YOUR* life easier so sod everyone else?

Well, that, and the improved purity of the language now that the false
idol called "integer division" has been banished back to whatever dank
hell from which it sprang.  :-)

It's not that big a deal for me; I'd be almost as happy with a special
"float division operator" like "/." or such.  However, if people are
thinking about getting rid of what I perceive as a wart, then I'm not
about to argue against it, am I?

-- 
Johann Hibschman                           johann at physics.berkeley.edu



More information about the Python-list mailing list