fact.lib
InvalidFactorialError
factorial(n: int) -> int
Computes the factorial through a recursive algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
A positive input value. |
required |
Raises:
| Type | Description |
|---|---|
InvalidFactorialError
|
If n is less than 0. |
Returns:
| Type | Description |
|---|---|
int
|
Computed factorial. |