I always wondered why the floats aren’t really acurate when computers should give the precise answer. I read in a book somewhere that it is better to compare a variable to a number around the value we want, since the calculate value may not always be a whole number as we expect. How do machines caluclate these divisions? Any links to websites are welcome 🙂
I always wondered why the floats aren’t really acurate when computers should give the
Share
Jon Skeet mentions it here (scroll down till you see “double d=0.3;” drawn on a slide):
http://msmvps.com/blogs/jon_skeet/archive/2009/11/02/omg-ponies-aka-humanity-epic-fail.aspx
A more detailed answer here:
http://download.oracle.com/docs/cd/E19957-01/806-3568/ncg_goldberg.html