public class MathUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static double |
fact(double n)
The factorial function (symbol: !) means to multiply a series of descending natural numbers.
|
static double |
fact(int n)
The factorial function (symbol: !) means to multiply a series of descending natural numbers.
|
static double |
max(double... values)
Finds the maximum value in the array.
|
static float |
max(float... values)
Finds the maximum value in the array.
|
static int |
max(int... values)
Finds the maximum value in the array.
|
static double |
min(double... values)
Finds the minimum value in the array.
|
static float |
min(float... values)
Finds the minimum value in the array.
|
static int |
min(int... values)
Finds the minimum value in the array.
|
static Double |
round(Double d,
int precision)
Rounds a Double value to a certain precision.
|
public static Double round(Double d, int precision)
d - the double value.precision - the precisionpublic static int max(int... values)
throws IllegalArgumentException
values - an array of int.IllegalArgumentException - if the array is null or empty.public static int min(int... values)
throws IllegalArgumentException
values - an array of int.IllegalArgumentException - if the array is null or empty.public static double max(double... values)
throws IllegalArgumentException
values - an array of double.IllegalArgumentException - if the array is null or empty.public static double min(double... values)
throws IllegalArgumentException
values - an array of double.IllegalArgumentException - if the array is null or empty.public static float max(float... values)
throws IllegalArgumentException
values - an array of float.IllegalArgumentException - if the array is null or empty.public static float min(float... values)
throws IllegalArgumentException
values - an array of float.IllegalArgumentException - if the array is null or empty.public static double fact(double n)
n - the fact of N, the int value of the double.public static double fact(int n)
n - n the fact of N,