Close to a value
class Utils {
private static final float EPSILON = 0.0001f;
public final static boolean close(float a, float b) {
return close(a, b, EPSILON);
}
public final static boolean close(float a, float b, float epsilon) {
return Math.abs(a - b) < epsilon;
}
}
Related examples in the same category