pub trait CheckedMultifactorial: Sized {
    fn checked_multifactorial(n: u64, m: u64) -> Option<Self>;
}

Required Methods§

Implementations on Foreign Types§

Computes a multifactorial of a number.

If the input is too large, the function returns None.

$$ f(n, m) = \begin{cases} \operatorname{Some}(n!^{(m)}) & \text{if} \quad n!^{(m)} < 2^W, \\ \operatorname{None} & \text{if} \quad n!^{(m)} \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

$n!^{(m)} = O(\sqrt{n}(n/e)^{n/m})$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Computes a multifactorial of a number.

If the input is too large, the function returns None.

$$ f(n, m) = \begin{cases} \operatorname{Some}(n!^{(m)}) & \text{if} \quad n!^{(m)} < 2^W, \\ \operatorname{None} & \text{if} \quad n!^{(m)} \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

$n!^{(m)} = O(\sqrt{n}(n/e)^{n/m})$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Computes a multifactorial of a number.

If the input is too large, the function returns None.

$$ f(n, m) = \begin{cases} \operatorname{Some}(n!^{(m)}) & \text{if} \quad n!^{(m)} < 2^W, \\ \operatorname{None} & \text{if} \quad n!^{(m)} \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

$n!^{(m)} = O(\sqrt{n}(n/e)^{n/m})$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Computes a multifactorial of a number.

If the input is too large, the function returns None.

$$ f(n, m) = \begin{cases} \operatorname{Some}(n!^{(m)}) & \text{if} \quad n!^{(m)} < 2^W, \\ \operatorname{None} & \text{if} \quad n!^{(m)} \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

$n!^{(m)} = O(\sqrt{n}(n/e)^{n/m})$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Computes a multifactorial of a number.

If the input is too large, the function returns None.

$$ f(n, m) = \begin{cases} \operatorname{Some}(n!^{(m)}) & \text{if} \quad n!^{(m)} < 2^W, \\ \operatorname{None} & \text{if} \quad n!^{(m)} \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

$n!^{(m)} = O(\sqrt{n}(n/e)^{n/m})$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Computes a multifactorial of a number.

If the input is too large, the function returns None.

$$ f(n, m) = \begin{cases} \operatorname{Some}(n!^{(m)}) & \text{if} \quad n!^{(m)} < 2^W, \\ \operatorname{None} & \text{if} \quad n!^{(m)} \geq 2^W, \end{cases} $$ where $W$ is Self::WIDTH.

$n!^{(m)} = O(\sqrt{n}(n/e)^{n/m})$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Implementors§