On 8/6/2011 8:34 PM, bearophile wrote:
Walter:

On 8/6/2011 4:46 PM, bearophile wrote:
Walter is not a lover of that -ffast-math switch.

No, I am not. Few understand the subtleties of IEEE arithmetic, and breaking
IEEE conformance is something very, very few should even consider.

I have read several papers about FP arithmetic, but I am not an expert yet on 
them. Both GDC and LDC have compilation switches to perform those unsafe FP 
optimizations, so even if you don't like them, most D compilers today have them 
optional, and I don't think those switches will be removed.

If you want to simulate a flock of boids (http://en.wikipedia.org/wiki/Boids ) 
on the screen using D, and you use floating point values to represent their 
speed vector, introducing unsafe FP optimizations will not harm so much. Video 
games are a significant purpose for D language, and in them FP errors are often 
benign (maybe some parts of the game are able to tolerate them and some other 
part of the game needs to be compiled with strict FP semantics).

Bye,
bearophile

Floating point determinism can be very important when it comes to reducing network traffic. If you can achieve it, then you can make sure all players have the same game state and then only send user input commands over the network.

Glenn Fiedler has an interesting writeup on it, but I haven't had a chance to read all of it yet:

http://gafferongames.com/networking-for-game-programmers/floating-point-determinism/

Reply via email to