PEP 238 (revised)

Guido van Rossum guido at python.org
Fri Jul 27 10:01:52 EDT 2001


David Eppstein <eppstein at ics.uci.edu> writes:

> I agree with the previous poster who said to use "quotient" instead of 
> "floor division".  Also, both types of division are mathematical results, 
> just of different operators.  So maybe instead of the unclear phrase "the 
> mathematical result" to denote, you know, the floating point style 
> division, maybe you could call it the ratio.
> 
> Example of this substitution made to first two paras:
> 
>     The current division (/) operator has an ambiguous meaning for 
>     numerical arguments: it returns the integer quotient of two ints or 
>     longs, but it returns a reasonable approximation of the ratio of two 
>     floats or complex numbers.  This makes expressions expecting float or 
>     complex results error-prone when integers are not expected but 
>     possible as inputs.
> 
>     We propose to fix this by introducing different operators for 
>     different operations: x/y to return a reasonable approximation of the 
>     ratio, x//y to return the quotient.  We call the current, mixed 
>     meaning of x/y "classic division".

You've got me halfway convinced here.  Let me think about that a bit.
It certainly makes shorter names!

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-list mailing list