public final class MathFunctions extends Object
| Constructor and Description |
|---|
MathFunctions() |
| Modifier and Type | Method and Description |
|---|---|
static double |
abs(double a)
Absolute value.
|
static double |
acos(double a)
Arcus cosine - inverse trigonometric cosine function
|
static double |
acosec(double a)
Arcus cosecant - inverse trigonometric cosecant function
|
static double |
actan(double a)
Arcus cotangent - inverse trigonometric cotangent function
|
static boolean |
almostEqual(double a,
double b)
Check whether two double values are almost equal.
|
static double |
arcosh(double a)
Arcus hyperbolic cosine - inverse hyperbolic cosine function.
|
static double |
arcoth(double a)
Arcus hyperbolic tangent - inverse hyperbolic tangent function.
|
static double |
arcsch(double a)
Arcus hyperbolic cosecant - inverse hyperbolic cosecant function.
|
static double |
arsech(double a)
Arcus hyperbolic secant - inverse hyperbolic secant function.
|
static double |
arsinh(double a)
Arcus hyperbolic sine - inverse hyperbolic sine function.
|
static double |
artanh(double a)
Arcus hyperbolic tangent - inverse hyperbolic tangent function.
|
static double |
asec(double a)
Arcus secant - inverse trigonometric secant function
|
static double |
asin(double a)
Arcus sine - inverse trigonometric sine function
|
static double |
atan(double a)
Arcus tangent - inverse trigonometric tangent function
|
static double |
bellNumber(double n)
Bell number
|
static double |
bellNumber(int n)
Bell Numbers
|
static double |
bernoulliNumber(double m,
double n)
Bernoulli numbers
|
static double |
bernoulliNumber(int m,
int n)
Bernoulli numbers
|
static double |
binomCoeff(double n,
double k)
Generalized binomial coefficient
|
static double |
binomCoeff(double n,
long k)
Generalized binomial coefficient
|
static double |
catalanNumber(double n)
Catalan numbers
|
static double |
catalanNumber(int n)
Catalan numbers
|
static double |
ceil(double a)
Ceiling function.
|
static double |
chi_L(double x,
double a,
double b)
Characteristic function x in [a,b)
|
static double |
chi_LR(double x,
double a,
double b)
Characteristic function x in [a,b]
|
static double |
chi_R(double x,
double a,
double b)
Characteristic function x in (a,b]
|
static double |
chi(double x,
double a,
double b)
Characteristic function x in (a,b)
|
static double |
coalesce(double[] values)
Returns the first non-NaN value
|
static double |
continuedFraction(double... sequence)
Continued fraction
|
static double |
continuedPolynomial(double... x)
Continued polynomial
|
static double |
cos(double a)
Cosine trigonometric function
|
static double |
cosec(double a)
Cosecant trigonometric function
|
static double |
cosh(double a)
Hyperbolic cosine function.
|
static double |
coth(double a)
Hyperbolic cotangent function.
|
static double |
csch(double a)
Hyperbolic cosecant function.
|
static double |
ctan(double a)
Cotangent trigonometric function
|
static int |
decimalDigitsBefore(double value)
For very small number returns the position of
first significant digit, ie 0.1 = 1, 0.01 = 2
|
static double |
deg(double a)
Radius to degrees translation.
|
static double |
div(double a,
double b)
Division a / b applying canonical rounding if canonical
rounding is enabled
|
static double |
eulerNumber(double n,
double k)
Euler numbers
|
static double |
eulerNumber(int n,
int k)
Euler numbers
|
static double |
eulerPolynomial(double m,
double x)
Euler polynomial
|
static double |
eulerPolynomial(int m,
double x)
Euler polynomial
|
static double |
exp(double a)
Exponential function.
|
static double |
factorial(double n)
Factorial
|
static double |
factorial(int n)
Factorial
|
static double |
fibonacciNumber(double n)
Fibonacci numbers
|
static double |
fibonacciNumber(int n)
Fibonacci numbers
|
static double |
floor(double a)
Floor function.
|
static double |
harmonicNumber(double n)
Harmonic number
|
static double |
harmonicNumber(double x,
double n)
Harmonic number 1/1 + 1/2^x + ... + 1/n^x
|
static double |
harmonicNumber(double x,
int n)
Harmonic number 1/1 + 1/2^x + ... + 1/n^x
|
static double |
harmonicNumber(int n)
Harmonic numer
|
static double |
integerPart(double x)
Returns integer part of a double value.
|
static boolean |
isAlmostInt(double a)
Verifies whether provided number is almost integer
|
static boolean |
isInteger(double x)
Check whether double value is almost integer.
|
static double |
kroneckerDelta(double i,
double j)
Kronecker delta
|
static double |
kroneckerDelta(int i,
int j)
Kronecker delta
|
static double |
ln(double a)
Natural logarithm
|
static double |
log(double a,
double b)
General logarithm.
|
static double |
log10(double a)
Common logarithm
|
static double |
log2(double a)
Binary logarithm
|
static double |
lucasNumber(double n)
Lucas numebrs
|
static double |
lucasNumber(int n)
Lucas numebrs
|
static double |
minus(double a,
double b)
Subtraction a - b applying canonical rounding if canonical
rounding is enabled
|
static double |
mod(double a,
double b)
Modulo operator a % b
|
static double |
multiply(double a,
double b)
Multiplication a * b applying canonical rounding if canonical
rounding is enabled
|
static double |
numberOfPermutations(double n,
double k)
Generalized coefficient returning number of k permutations
that can be drawn for n elements set.
|
static double |
numberOfPermutations(double n,
long k)
Generalized coefficient returning number of k permutations
that can be drawn for n elements set.
|
static double |
plus(double a,
double b)
Addition a + b applying canonical rounding if canonical
rounding is enabled
|
static double |
power(double a,
double b)
Power function a^b
|
static double |
rad(double a)
Degrees to radius translation.
|
static double |
root(double n,
double x)
Nth order root of a number
|
static double |
round(double value,
int places)
Double rounding
|
static double |
roundDown(double value,
int places)
Double down rounding
|
static double |
roundHalfUp(double value,
int places)
Double half up rounding
|
static double |
roundUlp(double number)
Unit in the last place rounding, see
0.1 + 0.1 + 0.1 vs roundUlp(0.1 + 0.1 + 0.1)
|
static double |
sa(double a)
Normalized sinc function.
|
static double |
sec(double a)
Secant trigonometric function
|
static double |
sech(double a)
Hyperbolic secant function.
|
static double |
sgn(double a)
Signum function.
|
static double |
sin(double a)
Sine trigonometric function
|
static double |
sinc(double a)
Sinc function.
|
static double |
sinh(double a)
Hyperbolic sine function.
|
static double |
sqrt(double a)
Square root.
|
static double |
Stirling1Number(double n,
double k)
Stirling numbers of the first kind
|
static double |
Stirling1Number(int n,
int k)
Stirling numbers of the first kind
|
static double |
Stirling2Number(double n,
double k)
Stirling numbers of the second kind
|
static double |
Stirling2Number(int n,
int k)
Stirling numbers of the second kind
|
static double |
tan(double a)
Tangent trigonometric function
|
static double |
tanh(double a)
Hyperbolic tangent function.
|
static double |
tetration(double a,
double n)
Tetration, exponential power, power series
|
static double |
ulp(double value)
Unit in the last place(ULP) for double
|
static int |
ulpDecimalDigitsBefore(double value)
Unit in The Last Place - number of decimal digits before
|
static double |
worpitzkyNumber(double n,
double k)
Worpitzky numbers
|
static double |
worpitzkyNumber(int n,
int k)
Worpitzky numbers
|
public static final double plus(double a,
double b)
a - The a parameterb - The b parameterpublic static final double minus(double a,
double b)
a - The a parameterb - The b parameterpublic static final double multiply(double a,
double b)
a - The a parameterb - The b parameterpublic static final double div(double a,
double b)
a - The a parameterb - The b parameterpublic static final double bellNumber(int n)
n - the npublic static final double bellNumber(double n)
n - the npublic static final double eulerNumber(int n,
int k)
n - the n function paramk - the k function parampublic static final double eulerNumber(double n,
double k)
n - the n function paramk - the k function parampublic static final double factorial(int n)
n - the n function parameterpublic static final double factorial(double n)
n - the n function parameterpublic static final double binomCoeff(double n,
long k)
n - the n function parameterk - k the k function parameterpublic static final double binomCoeff(double n,
double k)
n - the n function parameterk - the k function parameterpublic static final double numberOfPermutations(double n,
long k)
n - the n function parameterk - the k function parameterpublic static final double numberOfPermutations(double n,
double k)
n - the n function parameterk - the k function parameterpublic static final double bernoulliNumber(int m,
int n)
m - the m function parametern - the n function parameterpublic static final double bernoulliNumber(double m,
double n)
m - the m function parametern - the n function parameterpublic static final double Stirling1Number(int n,
int k)
n - the n function parameterk - the k function parameterpublic static final double Stirling1Number(double n,
double k)
n - the n function parameterk - the k function parameterpublic static final double Stirling2Number(int n,
int k)
n - the n function parameterk - the k function parameterpublic static final double Stirling2Number(double n,
double k)
n - the n function parameterk - the k function parameterpublic static final double worpitzkyNumber(int n,
int k)
n - the n function parameterk - the k function parameterpublic static final double worpitzkyNumber(double n,
double k)
n - the n function parameterk - the k function parameterpublic static final double harmonicNumber(int n)
n - the n function parameterpublic static final double harmonicNumber(double n)
n - the n function parameterpublic static final double harmonicNumber(double x,
int n)
x - the x function parametern - the n function parameterpublic static final double harmonicNumber(double x,
double n)
x - the x function parametern - the n function parameterpublic static final double catalanNumber(int n)
n - the n function parameterpublic static final double catalanNumber(double n)
n - the n function parameterpublic static final double fibonacciNumber(int n)
n - the n function parameterpublic static final double fibonacciNumber(double n)
n - the n function parameterpublic static final double lucasNumber(int n)
n - the n function parameterpublic static final double lucasNumber(double n)
n - the n function parameterpublic static final double kroneckerDelta(double i,
double j)
i - the i function parameterj - the j function parameterpublic static final double kroneckerDelta(int i,
int j)
i - the i function parameterj - the j function parameterpublic static final double continuedFraction(double... sequence)
sequence - the numberspublic static final double continuedPolynomial(double... x)
x - the x valuespublic static final double eulerPolynomial(int m,
double x)
m - the m parameterx - the x parameterpublic static final double eulerPolynomial(double m,
double x)
m - the m parameterx - the x parameterpublic static final double chi(double x,
double a,
double b)
x - the x valuea - the left (lower) limitb - the right (upper) limitpublic static final double chi_LR(double x,
double a,
double b)
x - the x valuea - the left (lower) limitb - the right (upper) limitpublic static final double chi_L(double x,
double a,
double b)
x - the x valuea - the left (lower) limitb - the right (upper) limitpublic static final double chi_R(double x,
double a,
double b)
x - the x valuea - the left (lower) limitb - the right (upper) limitpublic static final boolean isAlmostInt(double a)
a - The number to be verifiedBinaryRelations.DEFAULT_COMPARISON_EPSILONpublic static final double power(double a,
double b)
a - the a function parameterb - the b function parameterpublic static final double root(double n,
double x)
n - Root orderx - Numberpublic static final double tetration(double a,
double n)
a - basen - exponentpublic static final double mod(double a,
double b)
a - the a function parameterb - the b function parameterpublic static final double sin(double a)
a - the a function parameterpublic static final double cos(double a)
a - the a function parameterpublic static final double tan(double a)
a - the a function parameterpublic static final double ctan(double a)
a - the a function parameterpublic static final double sec(double a)
a - the a function parameterpublic static final double cosec(double a)
a - the a function parameterpublic static final double asin(double a)
a - the a function parameterpublic static final double acos(double a)
a - the a function parameterpublic static final double atan(double a)
a - the a function parameterpublic static final double actan(double a)
a - the a function parameterpublic static final double asec(double a)
a - the a function parameterpublic static final double acosec(double a)
a - the a function parameterpublic static final double ln(double a)
a - the a function parameterpublic static final double log2(double a)
a - the a function parameterpublic static final double log10(double a)
a - the a function parameterpublic static final double rad(double a)
a - the a function parameterpublic static final double exp(double a)
a - the a function parameterpublic static final double sqrt(double a)
a - the a function parameterpublic static final double sinh(double a)
a - the a function parameterpublic static final double cosh(double a)
a - the a function parameterpublic static final double tanh(double a)
a - the a function parameterpublic static final double coth(double a)
a - the a function parameterpublic static final double sech(double a)
a - the a function parameterpublic static final double csch(double a)
a - the a function parameterpublic static final double deg(double a)
a - the a function parameterpublic static final double abs(double a)
a - the a function parameterpublic static final double sgn(double a)
a - the a function parameterpublic static final double floor(double a)
a - the a function parameterpublic static final double ceil(double a)
a - the a function parameterpublic static final double arsinh(double a)
a - the a function parameterpublic static final double arcosh(double a)
a - the a function parameterpublic static final double artanh(double a)
a - the a function parameterpublic static final double arcoth(double a)
a - the a function parameterpublic static final double arsech(double a)
a - the a function parameterpublic static final double arcsch(double a)
a - the a function parameterpublic static final double sa(double a)
a - the a function parameterpublic static final double sinc(double a)
a - the a function parameterpublic static final double log(double a,
double b)
a - the a function parameter (base)b - the b function parameter (number)public static final double round(double value,
int places)
value - double value to be roundedplaces - decimal placespublic static final double roundHalfUp(double value,
int places)
value - double value to be roundedplaces - decimal placespublic static final double roundDown(double value,
int places)
value - double value to be roundedplaces - decimal placespublic static final double roundUlp(double number)
number - Double number that is to be roundeddecimalDigitsBefore(double),
ulp(double)public static final double integerPart(double x)
x - Numberpublic static final int decimalDigitsBefore(double value)
value - Double value, small one.public static final double ulp(double value)
value - Double numberpublic static final int ulpDecimalDigitsBefore(double value)
value - Double numberpublic static final double coalesce(double[] values)
values - List of valuespublic static final boolean isInteger(double x)
x - NumberBinaryRelations.DEFAULT_COMPARISON_EPSILONBinaryRelations.DEFAULT_COMPARISON_EPSILONpublic static final boolean almostEqual(double a,
double b)
a - First numberb - Second numberBinaryRelations.DEFAULT_COMPARISON_EPSILONBinaryRelations.DEFAULT_COMPARISON_EPSILONCopyright © 2020 MathParser.org. All rights reserved.