List of utility methods to do Factorial
long | factorial(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]; ... |
double | factorialDouble(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 ... |
double | factorialLog(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; ... |