pub trait ArrayRational<N: Numeric>where
    Self: Sized + Clone,{
    // Required methods
    fn lcm(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>;
    fn gcd(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>;
}
Expand description

ArrayTrait - Array Rational functions

Required Methods§

source

fn lcm(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>

Returns the lowest common multiple of |x1| and |x2|

Arguments
  • other - array to perform the operation with
Examples
use arr_rs::prelude::*;

assert_eq!(Array::single(60), Array::single(12).lcm(&Array::single(20).unwrap()));
source

fn gcd(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>

Returns the greatest common divisor of |x1| and |x2|

Arguments
  • other - array to perform the operation with
Examples
use arr_rs::prelude::*;

assert_eq!(Array::single(4), Array::single(12).gcd(&Array::single(20).unwrap()));

Implementations on Foreign Types§

source§

impl<N: Numeric> ArrayRational<N> for Result<Array<N>, ArrayError>

source§

fn lcm(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>

source§

fn gcd(&self, other: &Array<N>) -> Result<Array<N>, ArrayError>

Implementors§