It’s not a bug. When you are using floats, you are by definition only intested in lengths/weights/scalers up to an approximate value, where being over or under by 2^(-22) is acceptable. In your case, you are complaining that 24.99999 is being cast to int 24. That’s not a bug with the system or the language, it’s a bug with your code.
If you need to round to the NEAREST int, then use Mathf.RoundToInt, or something like that.
Strictly speaking, you shouldn’t even assume that the statement
int x = (int)(25f); // could assign 24 or 25 to x
will define x as 25. Casting to int will always round towards zero, and it’s possible that the closest float that the compiler will find to 25f is in fact 24.99999 (remember it works in binary, and my examples have been in decimal).
I suspect x would be 25 in this case, because for small integers, you can exactly represent them with floats, but for larger integers, that wouldn’t be true: e.g. int x = (int)(9876543f); might return 9876540, for example.
If you have a float which is meant to be an int, such as 25f, or 5/(0.2f), then one approach would be to define
int x = (int)(25f + 0.0001f);
to stop the potential rounding error.
I don’t know how C# handles floats, but if you look at how 32 bit floats (“single-precision”) work in C, you’ll see what I’m talking about: Single-precision floating-point format - Wikipedia