Skip to main content

Gcd

Trait Gcd 

Source
pub trait Gcd<T = Self> {
    type Output;

    // Required method
    fn gcd(&self, other: T) -> Self::Output;
}
Expand description

Is implemented by Z instances to calculate the gcd

Required Associated Types§

Required Methods§

Source

fn gcd(&self, other: T) -> Self::Output

Outputs the greatest common divisor (gcd) of the two given values with gcd(a, 0) = |a|.

Parameters:

  • other: specifies one of the values of which the gcd is computed

Returns the greatest common divisor of self and other.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Integer: Into<Z>> Gcd<Integer> for Z