Java Utililty Methods Epsilon

List of utility methods to do Epsilon

Description

The list of methods to do Epsilon are organized into topic(s).

Method

doubleepsilon(double v)
epsilon
if (Math.abs(v) < 1.0E-10)
    return 0.0;
return v;
longepsilonCeiling(double value)
Similar to Math.ceil(value), but adjusts small numerical rounding errors +- epsilon.
double epsilon = 0.0000001;
return (long) Math.ceil(value - epsilon);
booleanepsilonEquals(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;
booleanepsilonEquals(final float x, final float y)
epsilon Equals
return Math.abs(y - x) < 1.0E-5F;
booleanepsilonEquals(float f1, float f2, float epsilon)
epsilon Equals
return (f1 + epsilon >= f2 && f1 - epsilon <= f2);
booleanepsilonEquals(float p_180185_0_, float p_180185_1_)
epsilon Equals
return abs(p_180185_1_ - p_180185_0_) < 1.0E-5F;
booleanepsilonEquals(float v1, float v2)
Determines whether two values are "close enough" to equal.
return Math.abs(v1 - v2) < EPSILON;
doubleepsilonFloor(double d)
protect the floor function from the vagaries of floating point precision.
return Math.floor(d + epsilon);
booleanepsilonZero(double input)
epsilon Zero
return Math.abs(input) < 0.000001;