Compare two double values with Double.doubleToLongBits
public class Util { static public boolean areEqual(double aThis, double aThat) { return Double.doubleToLongBits(aThis) == Double.doubleToLongBits(aThat); } }