Trait GcdLcm

Source
pub trait GcdLcm {
    type Output;

    // Required methods
    fn gcd(self, _: Self::Output) -> Self::Output;
    fn lcm(self, _: Self::Output) -> Self::Output;
    fn gcd_lcm(self, _: Self::Output) -> (Self::Output, Self::Output);
}
Expand description

最大公約数・最小公倍数

Required Associated Types§

Source

type Output

GCD,LCMの計算結果の型

Required Methods§

Source

fn gcd(self, _: Self::Output) -> Self::Output

最大公約数を求める。

Source

fn lcm(self, _: Self::Output) -> Self::Output

最小公倍数を求める。

Source

fn gcd_lcm(self, _: Self::Output) -> (Self::Output, Self::Output)

最大公約数と最小公倍数を求める。

Implementations on Foreign Types§

Source§

impl GcdLcm for i8

Source§

type Output = i8

Source§

fn gcd(self, b: Self::Output) -> Self::Output

Source§

fn lcm(self, b: Self::Output) -> Self::Output

Source§

fn gcd_lcm(self, b: Self::Output) -> (Self::Output, Self::Output)

Source§

impl GcdLcm for i16

Source§

type Output = i16

Source§

fn gcd(self, b: Self::Output) -> Self::Output

Source§

fn lcm(self, b: Self::Output) -> Self::Output

Source§

fn gcd_lcm(self, b: Self::Output) -> (Self::Output, Self::Output)

Source§

impl GcdLcm for i32

Source§

type Output = i32

Source§

fn gcd(self, b: Self::Output) -> Self::Output

Source§

fn lcm(self, b: Self::Output) -> Self::Output

Source§

fn gcd_lcm(self, b: Self::Output) -> (Self::Output, Self::Output)

Source§

impl GcdLcm for i64

Source§

type Output = i64

Source§

fn gcd(self, b: Self::Output) -> Self::Output

Source§

fn lcm(self, b: Self::Output) -> Self::Output

Source§

fn gcd_lcm(self, b: Self::Output) -> (Self::Output, Self::Output)

Source§

impl GcdLcm for i128

Source§

type Output = i128

Source§

fn gcd(self, b: Self::Output) -> Self::Output

Source§

fn lcm(self, b: Self::Output) -> Self::Output

Source§

fn gcd_lcm(self, b: Self::Output) -> (Self::Output, Self::Output)

Source§

impl GcdLcm for isize

Source§

type Output = isize

Source§

fn gcd(self, b: Self::Output) -> Self::Output

Source§

fn lcm(self, b: Self::Output) -> Self::Output

Source§

fn gcd_lcm(self, b: Self::Output) -> (Self::Output, Self::Output)

Source§

impl GcdLcm for u8

Source§

type Output = u8

Source§

fn gcd(self, b: Self::Output) -> Self::Output

Source§

fn lcm(self, b: Self::Output) -> Self::Output

Source§

fn gcd_lcm(self, b: Self::Output) -> (Self::Output, Self::Output)

Source§

impl GcdLcm for u16

Source§

type Output = u16

Source§

fn gcd(self, b: Self::Output) -> Self::Output

Source§

fn lcm(self, b: Self::Output) -> Self::Output

Source§

fn gcd_lcm(self, b: Self::Output) -> (Self::Output, Self::Output)

Source§

impl GcdLcm for u32

Source§

type Output = u32

Source§

fn gcd(self, b: Self::Output) -> Self::Output

Source§

fn lcm(self, b: Self::Output) -> Self::Output

Source§

fn gcd_lcm(self, b: Self::Output) -> (Self::Output, Self::Output)

Source§

impl GcdLcm for u64

Source§

type Output = u64

Source§

fn gcd(self, b: Self::Output) -> Self::Output

Source§

fn lcm(self, b: Self::Output) -> Self::Output

Source§

fn gcd_lcm(self, b: Self::Output) -> (Self::Output, Self::Output)

Source§

impl GcdLcm for u128

Source§

type Output = u128

Source§

fn gcd(self, b: Self::Output) -> Self::Output

Source§

fn lcm(self, b: Self::Output) -> Self::Output

Source§

fn gcd_lcm(self, b: Self::Output) -> (Self::Output, Self::Output)

Source§

impl GcdLcm for usize

Source§

type Output = usize

Source§

fn gcd(self, b: Self::Output) -> Self::Output

Source§

fn lcm(self, b: Self::Output) -> Self::Output

Source§

fn gcd_lcm(self, b: Self::Output) -> (Self::Output, Self::Output)

Implementors§