how can i calculate float value?
eg it is 32/10 3.2 in calculator
in python 32/10 is 3.0
help me out

from __future__ import division
print 32/10
"""
My output:
3.2
"""

Basically, the from __future__ import division, will convert the / operator into the floor division operator, which will do the exact division.
Note that if you do such thing, the / operator which was before, meaning 32/10=[3], the real part of the number, will be changed to the floor division operator, and its effect will last throughout all script.
Another way is to use the double div operator, //

32//10

but I'm not that sure it will work, heh :D, gotta try:P

Later edit: Apparently the // ain't working for me...
You can get further help at this websites:
http://docs.python.org/release/2.2.3/whatsnew/node7.html
or
http://docs.python.org/reference/expressions.html

Edited 4 Years Ago by Lucaci Andrew: n/a

This question has already been answered. Start a new discussion instead.