[EMAIL PROTECTED] wrote: > Hi, I have the following functions, but ' dx = abs(i2 - i1)/min(i2, > i1)' always return 0, can you please tell me how can i convert it from > an integer to float?
When two integers are involved in a division, the result will also be a division. If one of the operands is a float, then the result will be a float instead. So try casting one of the values to a float before performing the division: dx = float(abs(i2 - i1))/min(i2, i1) -Farshid -- http://mail.python.org/mailman/listinfo/python-list