01: /**
02:    A class for useful numeric methods.
03: */
04: public class Numeric
05: {  
06:    /**
07:       Tests whether two floating-point numbers are.
08:       equal, except for a roundoff error
09:       @param x a floating-point number
10:       @param y a floating-point number
11:       @return true if x and y are approximately equal
12:    */
13:    public static boolean approxEqual(double x, double y)
14:    {  
15:       final double EPSILON = 1E-12;
16:       return Math.abs(x - y) <= EPSILON;
17:    }
18: }