It's Unity Engine(v2018.1) C#, .Net 3.5 equivalent version.
I got a strange floating point number operation.
The code goes like this.
float fa = 4.2f;
float fb = 10.0f;
float f1 = fa * fb;
int i1 = (int)(fa * fb);
int i2 = (int)f1;
int i3 = (int)42.0f;
Debug.Log(f1);
Debug.Log(i1);
Debug.Log(i2);
Debug.Log(i3);
// Log Result
//
// f1 : 42
// i1 : 41
// i2 : 42
// i3 : 42
//
i1 is the problem.
Integer type casting gives 41 not 42.
Anybody can give hint about this issue? FP precision or type casting problem?