Check out example codes for "java integer division tofloat". It will help you in understanding the concepts better.

Code Example 1

instead of writing
v = s/i (this does integer division)
write v = (float)s/i

Learn ReactJs, React Native from akashmittal.com