Trait malachite_base::num::arithmetic::traits::LcmAssign

source ·
pub trait LcmAssign<RHS = Self> {
    // Required method
    fn lcm_assign(&mut self, other: RHS);
}
Expand description

Replaces a number with the LCM (least common multiple) of it and another number.

Required Methods§

source

fn lcm_assign(&mut self, other: RHS)

Implementations on Foreign Types§

source§

impl LcmAssign for u8

source§

fn lcm_assign(&mut self, other: u8)

Replaces a number with the LCM (least common multiple) of it and another number.

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

§Worst-case complexity

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

$M(n) = O(n)$

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.

source§

impl LcmAssign for u16

source§

fn lcm_assign(&mut self, other: u16)

Replaces a number with the LCM (least common multiple) of it and another number.

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

§Worst-case complexity

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

$M(n) = O(n)$

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.

source§

impl LcmAssign for u32

source§

fn lcm_assign(&mut self, other: u32)

Replaces a number with the LCM (least common multiple) of it and another number.

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

§Worst-case complexity

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

$M(n) = O(n)$

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.

source§

impl LcmAssign for u64

source§

fn lcm_assign(&mut self, other: u64)

Replaces a number with the LCM (least common multiple) of it and another number.

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

§Worst-case complexity

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

$M(n) = O(n)$

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.

source§

impl LcmAssign for u128

source§

fn lcm_assign(&mut self, other: u128)

Replaces a number with the LCM (least common multiple) of it and another number.

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

§Worst-case complexity

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

$M(n) = O(n)$

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.

source§

impl LcmAssign for usize

source§

fn lcm_assign(&mut self, other: usize)

Replaces a number with the LCM (least common multiple) of it and another number.

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

§Worst-case complexity

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

$M(n) = O(n)$

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§