|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.hssf.record.formula.functions.MathX
public final class MathX
Method Summary | |
---|---|
static double |
acosh(double d)
inverse hyperbolic cosine |
static double |
asinh(double d)
inverse hyperbolic sine |
static double |
atanh(double d)
inverse hyperbolic tangent |
static double |
average(double[] values)
average of all values |
static double |
ceiling(double n,
double s)
Note: this function is different from java.lang.Math.ceil(..). |
static double |
cosh(double d)
hyperbolic cosine |
static double |
factorial(int n)
for all n >= 1; factorial n = n * (n-1) * (n-2) * ... |
static double |
floor(double n,
double s)
Note: this function is different from java.lang.Math.floor(..). |
static double |
max(double[] values)
min of all values. |
static double |
min(double[] values)
min of all values. |
static double |
mod(double n,
double d)
returns the remainder resulting from operation: n / d. |
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. |
static double |
product(double[] values)
product of all values |
static double |
round(double n,
int p)
Returns a value rounded to p digits after decimal. |
static double |
roundDown(double n,
int p)
Returns a value rounded to p digits after decimal. |
static double |
roundUp(double n,
int p)
Returns a value rounded-up to p digits after decimal. |
static short |
sign(double d)
If d < 0, returns short -1 If d > 0, returns short 1 If d == 0, returns short 0 |
static double |
sinh(double d)
hyperbolic sine |
static double |
sum(double[] values)
sum of all values |
static double |
sumproduct(double[][] arrays)
returns the sum of product of corresponding double value in each subarray. |
static double |
sumsq(double[] values)
sum of squares of all values |
static double |
sumx2my2(double[] xarr,
double[] yarr)
returns the sum of difference of squares of corresponding double value in each subarray: ie. |
static double |
sumx2py2(double[] xarr,
double[] yarr)
returns the sum of sum of squares of corresponding double value in each subarray: ie. |
static double |
sumxmy2(double[] xarr,
double[] yarr)
returns the sum of squares of difference of corresponding double value in each subarray: ie. |
static double |
tanh(double d)
hyperbolic tangent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static double round(double n, int p)
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.
n
- p
- public static double roundUp(double n, int p)
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.
n
- p
- public static double roundDown(double n, int p)
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.
n
- p
- public static short sign(double d)
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.
d
- public static double average(double[] values)
values
- public static double sum(double[] values)
values
- public static double sumsq(double[] values)
values
- public static double product(double[] values)
values
- public static double min(double[] values)
values
- public static double max(double[] values)
values
- 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:
n
- s
- 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:
n
- s
- public static double factorial(int n)
n
- public static double mod(double n, double d)
n
- d
- public static double acosh(double d)
d
- public static double asinh(double d)
d
- public static double atanh(double d)
d
- public static double cosh(double d)
d
- public static double sinh(double d)
d
- public static double tanh(double d)
d
- public static double sumproduct(double[][] arrays)
arrays
- public static double sumx2my2(double[] xarr, double[] yarr)
xarr
- yarr
- public static double sumx2py2(double[] xarr, double[] yarr)
xarr
- yarr
- public static double sumxmy2(double[] xarr, double[] yarr)
xarr
- yarr
- public static double nChooseK(int n, int k)
n
- k
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |