Class MathUtil

• public final class MathUtil
extends Object
Math utilities to be shared by numeric subjects.
• Method Summary

All Methods
Modifier and Type Method and Description
static boolean equalWithinTolerance(double left, double right, double tolerance)
Returns true iff left and right are finite values within tolerance of each other.
static boolean equalWithinTolerance(float left, float right, float tolerance)
Returns true iff left and right are finite values within tolerance of each other.
static boolean notEqualWithinTolerance(double left, double right, double tolerance)
Returns true iff left and right are finite values not within tolerance of each other.
static boolean notEqualWithinTolerance(float left, float right, float tolerance)
Returns true iff left and right are finite values not within tolerance of each other.
• Method Detail

• equalWithinTolerance

public static boolean equalWithinTolerance(double left,
double right,
double tolerance)
Returns true iff left and right are finite values within tolerance of each other. Note that both this method and notEqualWithinTolerance(double, double, double) returns false if either left or right is infinite or NaN.
• equalWithinTolerance

public static boolean equalWithinTolerance(float left,
float right,
float tolerance)
Returns true iff left and right are finite values within tolerance of each other. Note that both this method and notEqualWithinTolerance(double, double, double) returns false if either left or right is infinite or NaN.
• notEqualWithinTolerance

public static boolean notEqualWithinTolerance(double left,
double right,
double tolerance)
Returns true iff left and right are finite values not within tolerance of each other. Note that both this method and equalWithinTolerance(double, double, double) returns false if either left or right is infinite or NaN.
• notEqualWithinTolerance

public static boolean notEqualWithinTolerance(float left,
float right,
float tolerance)
Returns true iff left and right are finite values not within tolerance of each other. Note that both this method and equalWithinTolerance(double, double, double) returns false if either left or right is infinite or NaN.