PEP 238 (revised)
David Eppstein
eppstein at ics.uci.edu
Thu Jul 26 18:30:36 EDT 2001
In article <cp4rrz5onj.fsf at cj20424-a.reston1.va.home.com>,
Guido van Rossum <guido at python.org> wrote:
> Here's a completely revised version of PEP 238. It contains a long
> motivational section, a clear specification of what will happen, and a
> discussion of rejected alternatives, a list of open issues, a Q-and-A
> section etc.. I hope it answers most questions that have been raised
> about this issue. I'd be happy to revise it if there are still things
> unclear.
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".
--
David Eppstein UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/
More information about the Python-list
mailing list