Package com.google.common.truth
Class MathUtil
java.lang.Object
com.google.common.truth.MathUtil
Math utilities to be shared by numeric subjects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanequalWithinTolerance(double left, double right, double tolerance) Returns true iffleftandrightare finite values withintoleranceof each other.static booleanequalWithinTolerance(float left, float right, float tolerance) Returns true iffleftandrightare finite values withintoleranceof each other.static booleannotEqualWithinTolerance(double left, double right, double tolerance) Returns true iffleftandrightare finite values not withintoleranceof each other.static booleannotEqualWithinTolerance(float left, float right, float tolerance) Returns true iffleftandrightare finite values not withintoleranceof each other.
-
Constructor Details
-
MathUtil
private MathUtil()
-
-
Method Details
-
equalWithinTolerance
public static boolean equalWithinTolerance(double left, double right, double tolerance) Returns true iffleftandrightare finite values withintoleranceof each other. Note that both this method andnotEqualWithinTolerance(double, double, double)returns false if eitherleftorrightis infinite or NaN. -
equalWithinTolerance
public static boolean equalWithinTolerance(float left, float right, float tolerance) Returns true iffleftandrightare finite values withintoleranceof each other. Note that both this method andnotEqualWithinTolerance(double, double, double)returns false if eitherleftorrightis infinite or NaN. -
notEqualWithinTolerance
public static boolean notEqualWithinTolerance(double left, double right, double tolerance) Returns true iffleftandrightare finite values not withintoleranceof each other. Note that both this method andequalWithinTolerance(double, double, double)returns false if eitherleftorrightis infinite or NaN. -
notEqualWithinTolerance
public static boolean notEqualWithinTolerance(float left, float right, float tolerance) Returns true iffleftandrightare finite values not withintoleranceof each other. Note that both this method andequalWithinTolerance(double, double, double)returns false if eitherleftorrightis infinite or NaN.
-