Take a look at this article on the "The Perils of Floating Point" by
Bruce Bush.
http://www.lahey.com/float.htm
The discussion uses fortran code samples. Though you clearly aren't
using fortran in your code, the article should still be an easy read
for you and it is applicable regardless of your language of choice.
In it, a few very simple techniques are discussed on ways to handle
comparisons of floating point numbers. If you are going to do any
numerical programming, you really NEED to know (or should want to
know) the information discussed in the article.
Dan :-)
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.