Pep 238 Why new // operator (Non-integer Division)

Tim Peters tim.one at home.com
Fri Mar 16 19:14:54 EST 2001


[Gordon Williams]
> Why do we need a new // operator to do the divide operation.  If
> we want to do an integer divide with two reals why wont people just
> use int(a/b).  For

1. int() truncates.  Current i/j returns the floor.

2. There is no bound on the sizes of i and j; it's very easy to
   get Python long ints that don't fit in a Python float.





More information about the Python-list mailing list