Conversion to int rounds a float or double value towards zero.
1.1 -> 1, 1.99999999999 -> 1, 2.0 -> 2
-1.1 -> -1, -1.999999999 -> -1, -2 -> -2
Is that what you want? If yes, that's what you should do. If not, what do you want?
Floating-point arithmetic always gives rounding errors. So for example 0.2 * 10 will give a number that is close to 2. Might be a little bit less, or a little bit more, or by pure chance it might be exactly 2. Therefore (int) (0.2 * 10) might be 1 or 2, because "a little bit less than 2" will be converted to 1.
round (x) will round to the nearest integer. Again, if you calculate round (1.4 + 0.1), the sum of 1.4 and 0.1 is some number very close to 1.5, maybe a bit less, maybe a bit more, so you don't know if it gets rounded to 1.0 or 2.0.
Would you want all numbers from 1.5 to 2.5 to be rounded to 2? Use (int) round (x). You might get a slightly different result if x is 1.5 or 2.5. Maybe you want numbers up to 1.9999 to be rounded down, but 1.99999999 rounded to 2. Use double, not float, and calculate (int) (x + 0.000001).