change result from integer to float

divide can generate float result, but sometimes the result can be not
so accurate.