Are floating point operations in Delphi deterministic?
I.E. will I get the same result from an identical floating point mathematical operation on the same executable compiled with Delphi Win32 compiler as I would with the Win64 compiler, or the OS X compiler, or the iOS compiler, or the Android compiler?
This is a crucial question as I'm implementing multiplayer support in my game engine, and I'm concerned that the predictive results on the client side could very often differ from the definitive (and authoritative) determination of the server.
The consequence of this would be the appearance of "lag" or "jerkiness" on the client side when the authoritative game state data overrules the predictive state on the client side.
Since I don't realistically have the ability to test dozens of different devices on different platforms compiled with the different compilers in anything resembling a "controlled condition", I figure it's best to put this question to the Delphi developers out there to see if anyone has an internal understanding of floating point determinism at a low-level on the compilers.
sin
orcos
I don't think you can expect same results. If you limit the question to 4 arithmetic operations onDouble
orSingle
type maybe you can achieve the same results but I don't like the idea of relying on it because change of floating operation mode can change result of a floating operation even on a single platform. – Ubald1.0/10.0
without approximation. – Despondency1.0 / 1.0
just fine, which serves as an excellent counterexample to your broad, sweeping statement about floating-point math. There is no need to consider1.0 / 10.0
here. – Mudra