PEP0238 lament

Stephen Horne steve at lurking.demon.co.uk
Wed Jul 25 03:26:59 EDT 2001


On Tue, 24 Jul 2001 20:20:14 GMT, Guido van Rossum <guido at python.org>
wrote:

>Steve Horne <sh at ttsoftware.co.uk> writes:
>
>> The mathematical operation of division is traditionally represented as
>> ÷ in general - or as a horizontal line between the numerator and
>> denominator. Only rationals merit the / in mathematics - it's simply
>> the best compromise.
>> 
>> But mathematics uses the same set of symbols equally for both integer
>> and real division - it's rarely made explicit which is in use as it is
>> normally blatantly obvious. So I don't believe (1) is valid.
>
>I believe you are wrong here on both counts.  Knuth, a mathematician
>if there ever was one, uses / for division when written in-line and a
>horizontal line in "display" formulas.  He also uses an explicit floor
>notation to indicate integer division, and without that his divisions
>are real divisions.  (Knuth's floor notation acts like a pair of
>brackets around an expression; the left bracket looks like an L, the
>right bracket looks like a reverse L.  He has a similar ceiling
>notation where the L's are upside down.)

Being more explicit is essential when you are defining and proving
algorithms. Everyday application of those algorithms is a completely
different thing.

Most mathematics I've seen uses a mixture of '/' (or, rarely, '÷') and
horizontal lines even in the same expression - the issue is
convenience and clarity due to the length of the numerator and
denominator expressions, not the semantics of the notation.

In discrete mathematics, of course adding the additional explicit
floor/ceiling notations is the norm - for the same reason as when
defining and proving algorithms. However, it isn't always so - it's
just that in any currently *interesting* discrete mathematics, it *is*
necessary. Cases where it is not necessary are generally considered to
be done-and-dusted and boring, but that doesn't make them wrong - they
are the cases that happen in every day life, and which most frequently
occur in programming.




More information about the Python-list mailing list