Trait Egcd

Source
pub trait Egcd: Integer + Signed {
    // Provided method
    fn egcd(self, other: Self) -> (Self, Self, Self) { ... }
}
Expand description

A trait to compute the extended greatest common divisor of two integers.

Provided Methods§

Source

fn egcd(self, other: Self) -> (Self, Self, Self)

Compute the extended greatest common divisor of two integers. Returns (d, x, y) such that d = gcd(self, other) = self * x + other * y.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Integer + Signed> Egcd for T