Android Utililty Methods Factorial

List of utility methods to do Factorial

Description

The list of methods to do Factorial are organized into topic(s).

Method

longfactorial(final int n)
Returns n!.
if (n < 0) {
    throw new NotPositiveException(
            LocalizedFormats.FACTORIAL_NEGATIVE_PARAMETER, n);
if (n > 20) {
    throw new MathArithmeticException();
return FACTORIALS[n];
...
doublefactorialDouble(final int n)
Compute n!, the factorial of n (the product of the numbers 1 to n), as a double .
if (n < 0) {
    throw new NotPositiveException(
            LocalizedFormats.FACTORIAL_NEGATIVE_PARAMETER, n);
if (n < 21) {
    return FACTORIALS[n];
return FastMath
...
doublefactorialLog(final int n)
Compute the natural logarithm of the factorial of n .
if (n < 0) {
    throw new NotPositiveException(
            LocalizedFormats.FACTORIAL_NEGATIVE_PARAMETER, n);
if (n < 21) {
    return FastMath.log(FACTORIALS[n]);
double logSum = 0;
...