| java.lang.Object org.cougaar.util.MoreMath
MoreMath | public class MoreMath (Code) | | Additional math functions.
|
Method Summary | |
public static double | gammaLn(double xx) Returns the value ln[gamma(xx)] for xx > 0. | public static boolean | nearlyEquals(double a, double b) Compares two doubles for near equality. | public static boolean | nearlyEquals(double a, double b, double tolerance) Compares two doubles for near equality. |
gammaLn | public static double gammaLn(double xx)(Code) | | Returns the value ln[gamma(xx)] for xx > 0. Full accuracy is
obtained for xx > 1. For 0 < xx < 1, the reflection formula (6.1.4)
can be used first. Internal arithmetic will be done in double
precision, a nicety that you can omit if five figure accuracy is
good enough.
Algorithm from "Recipes for Scientific Computing"
|
nearlyEquals | public static boolean nearlyEquals(double a, double b)(Code) | | Compares two doubles for near equality. Equality comparisons of
doubles is instrinsically difficult because of rounding. This
methods checks the relative difference between two doubles and
their values.
Parameters: a - one of the values to compare Parameters: b - the other value to compare true if the difference is less than 1 part per billion |
nearlyEquals | public static boolean nearlyEquals(double a, double b, double tolerance)(Code) | | Compares two doubles for near equality. Equality comparisons of
doubles is instrinsically difficult because of rounding. This
methods checks the relative difference between two doubles and
their values.
Parameters: a - one of the values to compare Parameters: b - the other value to compare Parameters: tolerance - the allowable difference true if the difference divided by the sum of the absolutevalues of the parameters is less than the tolerance |
|
|