A use for integer quotients

Tim Peters tim at digicool.com
Mon Jul 23 18:44:08 EDT 2001


[Stephen Horne]
> ...
> We can't exactly match mathematics here, but we don't have to go so
> far as having different symbols for integer and float division -
> mathematics uses the same set of symbols for both operations allowing
> the context choose the operator.

This isn't so.  Mathematicians are careful to specify floor or ceiling
explicitly when they intend division to lose information, depending on
what's needed (see any text on number theory; see Knuth's TAoCP; see
anything).  Modern Lisps are closest to this (first a lossless divide, then
apply the rounding discipline you need).

> Why should we behave differently to what non-programmers such as
> mathematicians expect?

Since you don't want what mathemeticians expect, that's for you to answer
now.  Let me predict that you no longer think it's an important question
then <wink>.

Gratuitous advice:  stick with the backward compatibility arguments -- they
have some meat.





More information about the Python-list mailing list