Package com.google.common.truth
Class MathUtil
- java.lang.Object
-
- com.google.common.truth.MathUtil
-
final class MathUtil extends java.lang.Object
Math utilities to be shared by numeric subjects.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
MathUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
equalWithinTolerance(double left, double right, double tolerance)
Returns true iffleft
andright
are finite values withintolerance
of each other.static boolean
equalWithinTolerance(float left, float right, float tolerance)
Returns true iffleft
andright
are finite values withintolerance
of each other.static boolean
notEqualWithinTolerance(double left, double right, double tolerance)
Returns true iffleft
andright
are finite values not withintolerance
of each other.static boolean
notEqualWithinTolerance(float left, float right, float tolerance)
Returns true iffleft
andright
are finite values not withintolerance
of each other.
-
-
-
Method Detail
-
equalWithinTolerance
public static boolean equalWithinTolerance(double left, double right, double tolerance)
Returns true iffleft
andright
are finite values withintolerance
of each other. Note that both this method andnotEqualWithinTolerance(double, double, double)
returns false if eitherleft
orright
is infinite or NaN.
-
equalWithinTolerance
public static boolean equalWithinTolerance(float left, float right, float tolerance)
Returns true iffleft
andright
are finite values withintolerance
of each other. Note that both this method andnotEqualWithinTolerance(double, double, double)
returns false if eitherleft
orright
is infinite or NaN.
-
notEqualWithinTolerance
public static boolean notEqualWithinTolerance(double left, double right, double tolerance)
Returns true iffleft
andright
are finite values not withintolerance
of each other. Note that both this method andequalWithinTolerance(double, double, double)
returns false if eitherleft
orright
is infinite or NaN.
-
notEqualWithinTolerance
public static boolean notEqualWithinTolerance(float left, float right, float tolerance)
Returns true iffleft
andright
are finite values not withintolerance
of each other. Note that both this method andequalWithinTolerance(double, double, double)
returns false if eitherleft
orright
is infinite or NaN.
-
-