Package org.vandeseer.easytable.util
Class FloatUtil
- java.lang.Object
-
- org.vandeseer.easytable.util.FloatUtil
-
public final class FloatUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static doubleEPSILONThe delta that is still acceptable in float comparisons.
-
Constructor Summary
Constructors Constructor Description FloatUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisEqualInEpsilon(float x, float y)Floats can't hold any value (see https://www.geeksforgeeks.org/rounding-off-errors-java/).
-
-
-
Field Detail
-
EPSILON
public static final double EPSILON
The delta that is still acceptable in float comparisons.- See Also:
- Constant Field Values
-
-
Method Detail
-
isEqualInEpsilon
public static boolean isEqualInEpsilon(float x, float y)Floats can't hold any value (see https://www.geeksforgeeks.org/rounding-off-errors-java/). So this method is a workaround to compare to floats - all values where the difference is lower than 1.0E-4 are equal.- Parameters:
x- left valuey- right value- Returns:
- true, if difference between x and y lower than 1.0E-4.
-
-