Nope.
Originally, Python's / operator did floor division if its operands were both of type int or long, and true division otherwise. That is, 1/2 == 0, but 1.0/2.0 == 0.5. That behavior works fine for a statically-typed language like C, but in Python it caused problems. For example, consider the function
Code:
def mean(num_list):
return sum(num_list) / len(num_list)
mean([3.0, 4.0]) == 3.5, but mean([3, 4]) == 3. A lot of people complained about this. So Python decided to have two distinct division operators: / and //.
The // operator does floor division, even with floats.
Starting with Python 3.0 (currently in alpha and scheduled for final release in September), the / operator on ints will return the same as 1.0*x/y . As a transitional measure, this new behavior has been available since Python 2.2 if you start your script with:
Code:
from __future__ import division
Always do this. It's less error prone, and will make the transition to 3.0 easier.