Package com.google.common.truth
Class MathUtil
- java.lang.Object
-
- com.google.common.truth.MathUtil
-
final class MathUtil extends java.lang.ObjectMath utilities to be shared by numeric subjects.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateMathUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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.
-
-
-
Method Detail
-
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.
-
-