from __past__ import integerDivision (was Re: A modest PEP0238 suggestion)

Terry Reedy tjreedy at home.com
Mon Jul 23 22:32:26 EDT 2001


> I think this is what the PEP is proposing:

Suggest you read it -- more carefully than I did a month ago.

> // is current / behaviour

No,
x//y = floor(x/y) for both ints and floats, so that (x//y)*y + x%y = x
as close as possible

8//3 = 2,   8.0//3.0 = 2.0 which is similar to
8+3 = 11,  8.0+3.0 = 11.0

> / is new int/int --> fp

x/y is result with fraction so that (x/y)*y = x more or less







More information about the Python-list mailing list