Something went wrong on 5.5.2f1 update

Maybe I am going crazy but after the update (int)(16000 * 0.06f) started to return 959 instead of 960 and ruined my code.

Did I miss some memo or do I need more sleep?

Floats itself and any kind of calculation with floats produce slight inaccuracies. This can even differ when using different compilers, platforms / hardware etc.

What happens in your example is, that the result of the calculation happens to be 959.99xxx.
The final explicit cast to an int simply cuts of the .999.

Just round it using the common math functions.

Yes, all that is fine. Pocket calculator can return exact 960 value for that calculation as did Unity prior to some changes. I find it funny and also unsettling. I hope no space telescopes or mars missions will be failing because of such changes :wink:

They use different types for math, probably some kind of extremely precise fixed-point arithmetic, not quite sure though.
Even in game development, i.e. RTS games, you can usually find fixed-point arithmetics (for deterministic movement calculations) because floats can totally mess up the game.
There’s also an IEEE (754) standard for floating point calculations which defines everything related to the representation, calculation, rounding etc so that you get the same results over and over again.

I think all of the modern hardware supports it, but it’s not always enabled/used as there are optimizations which greatly speed up calculations when not using it.