public class MathExt
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static long |
binomial(int n,
int k)
Computes the binomial of n choose k.
|
static int |
doubleFactorial(int k)
Computes the double factorial of k, i.e. k!!.
|
static java.util.Set<java.lang.Integer> |
getIntegersFromTo(int from,
int to)
Gets a list of all integers for a certain range "from" to "to" (both inclusively).
|
static double |
round(double d,
int precision)
Rounds a double value to a certain number of decimal places.
|
public static long binomial(int n,
int k)
n - The size of the whole set.k - The size of the chosen subset.public static java.util.Set<java.lang.Integer> getIntegersFromTo(int from,
int to)
from - The lower bound (included).to - The upper bound (included).public static int doubleFactorial(int k)
k - The k for which to compute the double factorial for.public static double round(double d,
int precision)
d - The value to be rounded.precision - The number of decimal places.