Trait ArrayRational

Source
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()));
§Errors

may returns ArrayError

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()));
§Errors

may returns ArrayError

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.

Implementations on Foreign Types§

Source§

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

Source§

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

Source§

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

Implementors§