Are floating point operations in Delphi deterministic? -
Are floating point operations in Delphi deterministic? -
are floating point operations in delphi deterministic?
i.e. same result identical floating point mathematical operation on same executable compiled delphi win32 compiler win64 compiler, or os x compiler, or ios compiler, or android compiler?
this crucial question i'm implementing multiplayer back upwards in game engine, , i'm concerned predictive results on client side differ definitive (and authoritative) determination of server.
the consequence of appearance of "lag" or "jerkiness" on client side when authoritative game state info overrules predictive state on client side.
since don't realistically have ability test dozens of different devices on different platforms compiled different compilers in resembling "controlled condition", figure it's best set question delphi developers out there see if has internal understanding of floating point determinism @ low-level on compilers.
i think there no simple answer. similar task discussed here. in general, there 2 standards presentation of floating point numbers: ieee 754-1985 , eee 754-2008. modern (and quite old actually) cpus follow standards , guarantees things:
binary presentation of same standard floating type equal result of operations (not all, basic operations!) guaranteed equal, if compiler utilize same type of command, not sure true.but if utilize extended operations, such square root, result may vary different models of desktop cpus. can read article details: http://randomascii.wordpress.com/2013/07/16/floating-point-determinism/
p.s. tmyklebu mentioned, square root defined ieee 754, possible guarantee same result same input add, subtract, multiply, split , square root. few other operations defined ieee, details improve read ieee.
delphi floating-point cross-platform precision deterministic
Comments
Post a Comment