True Division in Python

kermit at polaris.net kermit at polaris.net
Wed Dec 6 18:41:04 EST 2006


For a long time,,   There has been a  discussion of trueFor  division
versus integer division in Python.


I myslef prefer that / be used for integer division since almost
always, I want the result of the
division be truncated to integer.

However, today I reviewed the method to be used in Python to get true
division, and this gave
me an idea how true division could be implemented without interferring
with the use of

/ for integer division.

Use  / for  integer division

single slash is the operator for integer division.

Use ./ for true division.

period slash is the operator for true division.

Kermit   <   kermit at polaris.net  >




More information about the Python-list mailing list