This is documentation for an old release of SciPy (version 0.10.1). Read this page in the documentation of the latest stable release (version 1.15.1).
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