List of utility methods to do Epsilon
double | epsilon(double v) epsilon if (Math.abs(v) < 1.0E-10) return 0.0; return v; |
long | epsilonCeiling(double value) Similar to Math.ceil(value), but adjusts small numerical rounding errors +- epsilon. double epsilon = 0.0000001; return (long) Math.ceil(value - epsilon); |
boolean | epsilonEquals(final double a, final double b, final double epsilon) Calculate whether the two scalars (a and b) are equal, given some slack value epsilon. final double diff = a - b; return diff < epsilon && diff > 0d - epsilon; |
boolean | epsilonEquals(final float x, final float y) epsilon Equals return Math.abs(y - x) < 1.0E-5F;
|
boolean | epsilonEquals(float f1, float f2, float epsilon) epsilon Equals return (f1 + epsilon >= f2 && f1 - epsilon <= f2);
|
boolean | epsilonEquals(float p_180185_0_, float p_180185_1_) epsilon Equals return abs(p_180185_1_ - p_180185_0_) < 1.0E-5F;
|
boolean | epsilonEquals(float v1, float v2) Determines whether two values are "close enough" to equal. return Math.abs(v1 - v2) < EPSILON;
|
double | epsilonFloor(double d) protect the floor function from the vagaries of floating point precision. return Math.floor(d + epsilon);
|
boolean | epsilonZero(double input) epsilon Zero return Math.abs(input) < 0.000001;
|