euc_lib 0.1.8

Easy to use implementation of extended and normanl Euclidean algorithm
Documentation
euc_lib-0.1.8 has been yanked.

euc_lib

Easy to use implementation of extended and normanl Euclidean algorithm

Want to contribute?:

My github:

Project:

Support:

Example usage:

Extended

Program

use euc_lib;
fn main() {
    prinln!("{:?}", euc_lib::euc_ext(135, 35));
}

Output

EucRes { d: 5, s: -1, t: 4 }

Simple

Program

use euc_lib;
fn main() {
    prinln!("{}", euc_lib::euc(135, 35)); // there is recursive variant too: euc_recursive(135,35)
}

Output

5

Vector as an argument

Program

use euc_lib;
fn main() {
    println!("{:?}", euc_lib::euc_from_vec(vec![21, 14, 56]));
}

Output

Ok(7)

LCM

This version implements Least common multiple calculating method using gcd (Euclidean algorithm)

Program

use euc_lib;
fn main () {
    println!("{:?}", euc_lib::lcm(21, 6)) // there is recursive variant too: lcm_recursive
}

Output

42