public class BigFunctions extends Object
Constructor and Description |
---|
BigFunctions() |
Modifier and Type | Method and Description |
---|---|
static BigDecimal |
exp(BigDecimal bigDecimal,
MathContext mathContext)
Returns the value of the exponential of the given BigDecimal using the
given MathContext.
|
static BigDecimal |
expBD(BigDecimal x,
MathContext mathContext)
Returns the value of the exponential of the given BigDecimal using the
given MathContext.
|
static BigInteger |
factorial(BigInteger n)
Returns n! as BigInteger.
|
static BigInteger |
factorial(BigInteger n,
BigInteger k)
Returns n!/k! as BigInteger.
|
static BigInteger |
getCombination(BigInteger k,
BigInteger n)
Returns the number of k-combinations in a set of n elements as a big
decimal.
|
static BigDecimal |
getMaxExp(MathContext mathContext)
Returns the estimated maximal value exp can be calculated on according to
the mathContext.
|
static BigDecimal |
ln(BigDecimal bigDecimal,
MathContext mathContext)
Returns the natural logarithm of a big decimal.
|
static BigDecimal |
lnBD(BigDecimal bigDecimal,
MathContext mathContext)
Returns the log of a big decimal.
|
static BigDecimal |
log(BigDecimal input,
double base,
MathContext mathContext)
Returns the log of the input in the desired base.
|
static BigDecimal |
pow(BigDecimal x1,
BigDecimal x2,
MathContext mathContext)
Returns the first big decimal power the second using the given math
context.
|
public static BigInteger factorial(BigInteger n)
n
- a given BigIntegerpublic static BigInteger factorial(BigInteger n, BigInteger k)
n
- a given BigIntegerk
- a given BigIntegerpublic static BigInteger getCombination(BigInteger k, BigInteger n)
k
- the number of k-combinationsn
- the number of elementspublic static BigDecimal ln(BigDecimal bigDecimal, MathContext mathContext)
bigDecimal
- the big decimal to estimate the log onmathContext
- the math context to use for the calculationpublic static BigDecimal lnBD(BigDecimal bigDecimal, MathContext mathContext)
bigDecimal
- the big decimal to estimate the log onmathContext
- the math context to use for the calculationpublic static BigDecimal log(BigDecimal input, double base, MathContext mathContext)
input
- the inputbase
- the log basemathContext
- the math context to use for the calculationpublic static BigDecimal exp(BigDecimal bigDecimal, MathContext mathContext)
bigDecimal
- the big decimalmathContext
- the math contextpublic static BigDecimal getMaxExp(MathContext mathContext)
mathContext
- the math context to use for the calculationpublic static BigDecimal expBD(BigDecimal x, MathContext mathContext)
x
- the big decimalmathContext
- the math contextpublic static BigDecimal pow(BigDecimal x1, BigDecimal x2, MathContext mathContext)
x1
- the first big decimalx2
- the second big decimalmathContext
- the math contextCopyright © 2016. All rights reserved.