A simple comparison of two double values in Java creates some problems. Let\'s consider the following simple code snippet in Java.
package doublecomparision;
Basically you shouldn't do exact comparisons, you should do something like this:
double a = 1.000001; double b = 0.000001; double c = a-b; if (Math.abs(c-1.0) <= 0.000001) {...}