Remember: 2.0+2.0!=4.0. I think this is just roundoff error, .245*1000 can be smaller then 245.
edit: Solution: define new class for double and make new operator== which will do something like that:
if(a<b*(1+epsilon) && a>b*(1-epsilon)) return true;
return fals;
where epsilon is desired precision (10**-10 would be good).
Last edited by Zjarek; Oct 16th, 2009 at 6:53 pm.
Reputation Points: 20
Solved Threads: 18
Junior Poster in Training
Offline 79 posts
since Oct 2009