In C#, I am doing something like this:
float a = 4.0f;
float b = 84.5f;
int ans = a * b;
However, the compiler states that a cast is required to go from float -> int in assignment. Of course I could probably do this:
int ans = (int)a * (int)b;
But this is ugly and redundant. Is there a better way? I know in C++ I could do this:
int ans = int(a * b);
At least that looks a little better on the eyes. But I can't do this in C# it seems.