Floating Point Numbers are fun!

and slightly confusing at times. In my day job i sometimes stumble upon problems related to accumulating errors due to the funny behaviour of floating point numbers, rounding modes of the FPU and so on (granted that happens maybe once in a year). Never the less, every programmer worthi his/her salt should read the following paper by Goldberg

What every computer scientist should know about floating point arithmetic

I stumbled over another attempt to clear up some of the myths surrounding floats on slashdot which you can find at http://floating-point-gui.de/. Personally i find the Goldberg article a much better read, the later is more for the busy stressed out types that just want the (partially incomplete) summary. Chose your poison.

On a related note: Dalvik on Android supports strictfp which might impact performance (as is the case on desktop pcs) but might ease your pain a little if you ever plan to write a deterministic simulation (like an RTS :)).

2 thoughts on “Floating Point Numbers are fun!

Leave a Reply

Your email address will not be published.