This question is bothering me for a while now. A Java VM should behave exactly the same on different platforms and hardware!? I believe that includes integer and floating point operations as well? A floating point multiplication will always return the same result no matter where it is executed? Correct?
“strictfp” implies otherwise? float might get treated differently on different platforms? I don’t get it ???
I am asking because it is somewhat relevant to multiplayer gaming. Let’s assume I have the same game state on multiple machines which I try to keep in sync. If these game states contain floating point variables, updating these floating point variables over time might result in different float values? E.g. one being 2.300000, the other 2.299999?
Do I need to use strictfp for all my float variables in the data model? Any experiences? Examples?