| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static double | |
| public static double | |
| public static double | |
| public static double | |
| public static double | ceiling(double n, double s)
When n and s are "valid" arguments, the returned value is: Math.ceiling(n/s) * s; n and s are invalid if any of following conditions are true:
|
| public static double | |
| public static double | |
| public static double | |
| public static double | floor(double n, double s)
When n and s are "valid" arguments, the returned value is: Math.floor(n/s) * s; n and s are invalid if any of following conditions are true:
|
| public static double | |
| public static double | |
| public static double | |
| public static double | nChooseK(int n, int k)
returns the total number of combinations possible when k items are chosen out of total of n items. |
| public static double | |
| public static double | |
| public static double | |
| private static double | |
| public static double | |
| public static double | |
| public static double | |
| public static double | |
| public static double | |
| public static short | sign(double d)
If d < 0, returns short -1 If d > 0, returns short 1 If d == 0, returns short 0 If d is NaN, then 1 will be returned. |
| public static double | |
| public static double | |
| public static double | |
| public static double |
| MathX | back to summary |
|---|---|
| private MathX() | |
| acosh | back to summary |
|---|---|
| public static double acosh(double d) inverse hyperbolic cosine | |
| asinh | back to summary |
|---|---|
| public static double asinh(double d) inverse hyperbolic sine | |
| atanh | back to summary |
|---|---|
| public static double atanh(double d) inverse hyperbolic tangent | |
| average | back to summary |
|---|---|
| public static double average(double[] values) average of all values | |
| ceiling | back to summary |
|---|---|
| public static double ceiling(double n, double s) Note this function is different from java.lang.Math.ceil(..).
When n and s are "valid" arguments, the returned value is: Math.ceiling(n/s) * s;
| |
| cosh | back to summary |
|---|---|
| public static double cosh(double d) hyperbolic cosine | |
| factorial | back to summary |
|---|---|
| public static double factorial(int n)
| |
| factorial | back to summary |
|---|---|
| public static double factorial(double d) | |
| floor | back to summary |
|---|---|
| public static double floor(double n, double s) Note this function is different from java.lang.Math.floor(..).
When n and s are "valid" arguments, the returned value is: Math.floor(n/s) * s;
| |
| max | back to summary |
|---|---|
| public static double max(double[] values) min of all values. If supplied array is zero length, Double.NEGATIVE_INFINITY is returned. | |
| min | back to summary |
|---|---|
| public static double min(double[] values) min of all values. If supplied array is zero length, Double.POSITIVE_INFINITY is returned. | |
| mod | back to summary |
|---|---|
| public static double mod(double n, double d) returns the remainder resulting from operation:
n / d.
| |
| nChooseK | back to summary |
|---|---|
| public static double nChooseK(int n, int k) returns the total number of combinations possible when k items are chosen out of total of n items. If the number is too large, loss of precision may occur (since returned value is double). If the returned value is larger than Double.MAX_VALUE, Double.POSITIVE_INFINITY is returned. If either of the parameters is negative, Double.NaN is returned. | |
| product | back to summary |
|---|---|
| public static double product(double[] values) product of all values | |
| round | back to summary |
|---|---|
| public static double round(double n, int p) Returns a value rounded to p digits after decimal. If p is negative, then the number is rounded to places to the left of the decimal point. eg. 10.23 rounded to -1 will give: 10. If p is zero, the returned value is rounded to the nearest integral value. If n is negative, the resulting value is obtained as the round value of absolute value of n multiplied by the sign value of n (@see MathX.sign(double d)). Thus, -0.6666666 rounded to p=0 will give -1 not 0. If n is NaN, returned value is NaN. | |
| round | back to summary |
|---|---|
| public static double round(double n, double p) | |
| round | back to summary |
|---|---|
| private static double round(double n, int p, RoundingMode rounding) | |
| roundDown | back to summary |
|---|---|
| public static double roundDown(double n, int p) Returns a value rounded to p digits after decimal. If p is negative, then the number is rounded to places to the left of the decimal point. eg. 10.23 rounded to -1 will give: 10. If p is zero, the returned value is rounded to the nearest integral value. If n is negative, the resulting value is obtained as the round-up value of absolute value of n multiplied by the sign value of n (@see MathX.sign(double d)). Thus, -0.8 rounded-down to p=0 will give 0 not -1. If n is NaN, returned value is NaN. | |
| roundDown | back to summary |
|---|---|
| public static double roundDown(double n, double p) | |
| roundUp | back to summary |
|---|---|
| public static double roundUp(double n, int p) Returns a value rounded-up to p digits after decimal. If p is negative, then the number is rounded to places to the left of the decimal point. eg. 10.23 rounded to -1 will give: 20. If p is zero, the returned value is rounded to the nearest integral value. If n is negative, the resulting value is obtained as the round-up value of absolute value of n multiplied by the sign value of n (@see MathX.sign(double d)). Thus, -0.2 rounded-up to p=0 will give -1 not 0. If n is NaN, returned value is NaN. | |
| roundUp | back to summary |
|---|---|
| public static double roundUp(double n, double p) | |
| scaledRoundUsingBigDecimal | back to summary |
|---|---|
public static double scaledRoundUsingBigDecimal(double xval, double multiplier, RoundingMode mode)
| |
| sign | back to summary |
|---|---|
| public static short sign(double d) If d < 0, returns short -1
If d is NaN, then 1 will be returned. It is the responsibility of caller to check for d isNaN if some other value is desired. | |
| sinh | back to summary |
|---|---|
| public static double sinh(double d) hyperbolic sine | |
| sum | back to summary |
|---|---|
| public static double sum(double[] values) sum of all values | |
| sumsq | back to summary |
|---|---|
| public static double sumsq(double[] values) sum of squares of all values | |
| tanh | back to summary |
|---|---|
| public static double tanh(double d) hyperbolic tangent | |