Check that n
is an odd Integer.
For the case where n
is a positive Integer, continue to recurse through lesser positive Integers until 1
is reached.
For the case where n
is a negative Integer, use the inversion of its recurrence relation as
described at the Wikipedia page.
Double Factorial
The Double Factorial is the product of all the odd integers up to a specified odd positive integer. The mathematical notation is
n!!
.Because the Chi Squared, Student's t, and Weibull Distributions require the Gamma Function, and because this use of the Gamma Function requires it to be defined for negative odd integers, that case is handled by this recursive implementation.
Assumptions
n
is an odd Integer.Use
mctad.doubleFactorial(n)
Inline Comments