Double factorial.
This is the factorial with every second value skipped, i.e., 7!! = 7 * 5 * 3 * 1. It can be approximated numerically as:
n!! = special.gamma(n/2+1)*2**((m+1)/2)/sqrt(pi) n odd
= 2**(n/2) * (n/2)! n even
Parameters : | n : int or array_like
exact : bool, optional
|
---|---|
Returns : | nff : float or int
|
Examples
>>> factorial2(7, exact=False)
array(105.00000000000001)
>>> factorial2(7, exact=True)
105L