03-15-2008 07:34 PM
03-15-2008 09:38 PM
03-16-2008 04:57 AM - edited 03-16-2008 04:59 AM
03-16-2008 08:13 AM
03-16-2008 09:06 AM
03-16-2008 07:02 PM - edited 03-16-2008 07:03 PM
03-17-2008 08:58 AM
Why is comparing DBL's for equality such a problem? What sort of unexpected results are we talking about?
How can I get around comparing the DBL's? The doubles in the second if statement are real world values, if I change the "type" from DBl would that fix the problem? If so, how do I do that?
Thanks!
03-17-2008 09:06 AM
See this article regarding the problem with DBLs. In particular read the section on accuracy problems.
http://en.wikipedia.org/wiki/Floating_point_numbers
03-17-2008 09:15 AM
03-17-2008 09:16 AM
Thanks for the link. I have read through it. Could the reason that my second if statement is never executed be due to the fact that I am comparing DBL's?
The wierd thing is I use the saem structure of code elsewhere in my program (the 2nd if statement) and I have no problems.
What sory of work arounds are there?