Posted on 06/25/2010 11:29:39 AM PDT by Southnsoul
That being said, you are right, there are some numbers which cannot be represented exactly using floating-opoint arithmetic, including (I think) the square root of two (or was it three?).
I recall working on optimizing an engineering simulation program where we had to turn off compiler options in order to get the answers to come out right: the compiler was taking a group of operands and rearranging the order they were being added in -- with the side effect that some of the smaller numbers were "dropped" as rounding errors. We had to change the code by hand so that it sorted the numbers first, and then began adding from smallest to largest...
Cheers!
I’ll take “D:” Adolf the above.
America’s Directive 10-289.
Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.