I have a method in java that returns a double number and I want to compare every double number that is returned every time I call the method(say 5 times), so that I can conclude that the number returned is almost the same every time.
How can I do this?
public static boolean almostEqual(double a, double b, double eps){
return Math.abs(a-b)<eps;
}
Where eps is measure of equality.