The factorial function, n! = special.gamma(n+1).
If exact is 0, then floating point precision is used, otherwise exact long integer is computed.
Parameters : | n : int or array_like of ints
exact : bool, optional
|
---|---|
Returns : | nf : float or int
|
Examples
>>> arr = np.array([3,4,5])
>>> sc.factorial(arr, exact=False)
array([ 6., 24., 120.])
>>> sc.factorial(5, exact=True)
120L