@Test public void aequalFloatsWithTol() { float tol = 0.1f; float x1 = 42; float x2 = x1 + tol * 10; assertFalse(CompareOp.aequal(x1, x2, tol)); x2 = x1 + tol / 10; assertTrue(CompareOp.aequal(x1, x2, tol)); }
public static boolean aequal(double x1, double x2) { return isZero(x1 - x2); }
CompareOp { public static boolean aequal(double x1, double x2) { return isZero(x1 - x2); } }
CompareOp { public static boolean aequal(double x1, double x2) { return isZero(x1 - x2); }  }
CompareOp { public static boolean aequal(double x1, double x2) { return isZero(x1 - x2); }  static boolean isZero(double x); static boolean isZero(float x); static boolean isZero(double x, double tol); static boolean isZero(float x, float tol); static int acompare(double x1, double x2); static int acompare(float x1, float x2); static int acompare(double x1, double x2, double tol); static int acompare(float x1, float x2, float tol); static int pcompare(double x1, double x2, double propTol); static int pcompare(float x1, float x2, float propTol); static boolean aequal(double x1, double x2); static boolean aequal(float x1, float x2); static boolean aequal(double x1, double x2, double tol); static boolean aequal(float x1, float x2, float tol); static boolean pequal(double x1, double x2, double propTol); static boolean pequal(float x1, float x2, float propTol); }
CompareOp { public static boolean aequal(double x1, double x2) { return isZero(x1 - x2); }  static boolean isZero(double x); static boolean isZero(float x); static boolean isZero(double x, double tol); static boolean isZero(float x, float tol); static int acompare(double x1, double x2); static int acompare(float x1, float x2); static int acompare(double x1, double x2, double tol); static int acompare(float x1, float x2, float tol); static int pcompare(double x1, double x2, double propTol); static int pcompare(float x1, float x2, float propTol); static boolean aequal(double x1, double x2); static boolean aequal(float x1, float x2); static boolean aequal(double x1, double x2, double tol); static boolean aequal(float x1, float x2, float tol); static boolean pequal(double x1, double x2, double propTol); static boolean pequal(float x1, float x2, float propTol); static final double DTOL; static final float FTOL; }