pub trait Factorial {
type Output;
// Required method
fn factorial(&self) -> Self::Output;
}
Expand description
Allows the usage of factorials i.e. x!
usually defined as:
- x! = x*(x-1)!
- 0! = 1
for x ∈ ℕ.
The definition of the factorial function can be expanded to the domain of all real numbers using the gamma function:
x! = 𝜞(x+1)