public final class MathFunctions extends Object
Constructor and Description |
---|
MathFunctions() |
Modifier and Type | Method and Description |
---|---|
static double |
abs(double a) |
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 |
div(double a,
double b)
Division a / b applying canonical rounding if canonical rounding is enabled
|
static double |
factorial(double n)
Factorial
|
static double |
factorial(int n)
Factorial
|
static double |
floor(double a)
Floor function.
|
static boolean |
isInteger(double x)
Check whether double value is almost integer.
|
static double |
ln(double a)
Natural logarithm
|
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 |
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 |
round(double value,
int places)
Double rounding
|
static double |
sqrt(double a)
Square root.
|
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
|
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 abs(double a)
public 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 power(double a, double b)
a
- the a function parameterb
- the b function parameterpublic 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 ln(double a)
a
- the a function parameterpublic static final double sqrt(double a)
a
- the a function parameterpublic static final double floor(double a)
a
- the a function parameterpublic static final double round(double value, int places)
value
- double value to be roundedplaces
- decimal placespublic 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 boolean isInteger(double x)
x
- NumberBinaryRelations.DEFAULT_COMPARISON_EPSILON
BinaryRelations.DEFAULT_COMPARISON_EPSILON