pub trait Lcm<RHS = Self> {
    type Output;

    fn lcm(self, other: RHS) -> Self::Output;
}
Expand description

Calculates the LCM (least common multiple) of two numbers.

Required Associated Types

Required Methods

Implementations on Foreign Types

Computes the LCM (least common multiple) of two numbers.

$$ f(x, y) = \operatorname{lcm}(x, y). $$

Worst-case complexity

$T(n) = O(n^2)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is max(self.significant_bits(), other.significant_bits()).

Panics

Panics if the result is too large to be represented.

Examples

See here.

Computes the LCM (least common multiple) of two numbers.

$$ f(x, y) = \operatorname{lcm}(x, y). $$

Worst-case complexity

$T(n) = O(n^2)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is max(self.significant_bits(), other.significant_bits()).

Panics

Panics if the result is too large to be represented.

Examples

See here.

Computes the LCM (least common multiple) of two numbers.

$$ f(x, y) = \operatorname{lcm}(x, y). $$

Worst-case complexity

$T(n) = O(n^2)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is max(self.significant_bits(), other.significant_bits()).

Panics

Panics if the result is too large to be represented.

Examples

See here.

Computes the LCM (least common multiple) of two numbers.

$$ f(x, y) = \operatorname{lcm}(x, y). $$

Worst-case complexity

$T(n) = O(n^2)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is max(self.significant_bits(), other.significant_bits()).

Panics

Panics if the result is too large to be represented.

Examples

See here.

Computes the LCM (least common multiple) of two numbers.

$$ f(x, y) = \operatorname{lcm}(x, y). $$

Worst-case complexity

$T(n) = O(n^2)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is max(self.significant_bits(), other.significant_bits()).

Panics

Panics if the result is too large to be represented.

Examples

See here.

Computes the LCM (least common multiple) of two numbers.

$$ f(x, y) = \operatorname{lcm}(x, y). $$

Worst-case complexity

$T(n) = O(n^2)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is max(self.significant_bits(), other.significant_bits()).

Panics

Panics if the result is too large to be represented.

Examples

See here.

Implementors