
Most of the suggestions are to avoid floating-point numbers from equality checking or in condition checking. Because small errors in the rightmost decimal places are likely to arise when calculations are performed on floating-point numbers, And two float or double values (float and double are also different) rarely are exactly equal.
assume ,
double oneThird = 1.0 / 3.0;
double x = oneThird + oneThird + oneThird;
actually...