Conversion Between Ints and Floats
If you mix ints and floats in an expression, the result will always be a
float
.
Note that when you divide twoint
s, you get afloat
back.
A value can be explicity coerced (i.e. converted) using theint
andfloat
functions.
Calling theint
function on a float truncates everything after the decimal point.