Most likely for you:
Assuming that IEEE or similar floats 1.3 cannot be represented and probably something like 1.299999, which is multiplied by 10, is 12.99999, which is then truncated to int is 12.
However, 1.3 * 10 can be evaluated at compile time, which is likely to lead to an accurate representation of 13.
Depending on how your code is really structured, which compiler is used and what parameters it is used with, it can evaluate from one to 12 or 13, depending on whether it is executed at startup or compilation time.
For completeness, with the following code, I could reproduce it:
extern int result0; extern int result1; float val = 1.3f; void foo( ) { result0 = val * int(10);
Plasmahh
source share