pub trait Factorial {
    fn factorial(n: u64) -> Self;
}

Required Methods

Implementations on Foreign Types

Computes the factorial of a number.

If the input is too large, the function panics. For a function that returns None instead, try CheckedFactorial.

$$ f(n) = n! = 1 \times 2 \times 3 \times \cdots \times n. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Computes the factorial of a number.

If the input is too large, the function panics. For a function that returns None instead, try CheckedFactorial.

$$ f(n) = n! = 1 \times 2 \times 3 \times \cdots \times n. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Computes the factorial of a number.

If the input is too large, the function panics. For a function that returns None instead, try CheckedFactorial.

$$ f(n) = n! = 1 \times 2 \times 3 \times \cdots \times n. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Computes the factorial of a number.

If the input is too large, the function panics. For a function that returns None instead, try CheckedFactorial.

$$ f(n) = n! = 1 \times 2 \times 3 \times \cdots \times n. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Computes the factorial of a number.

If the input is too large, the function panics. For a function that returns None instead, try CheckedFactorial.

$$ f(n) = n! = 1 \times 2 \times 3 \times \cdots \times n. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Computes the factorial of a number.

If the input is too large, the function panics. For a function that returns None instead, try CheckedFactorial.

$$ f(n) = n! = 1 \times 2 \times 3 \times \cdots \times n. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Implementors