Trait statrs::euclid::Modulus [] [src]

pub trait Modulus {
    fn modulus(self, divisor: Self) -> Self;
}

Provides a trait for the canonical modulus operation since % is technically the remainder operation

Required Methods

Performs a canonical modulus operation between self and divisor.

Examples

use statrs::euclid::Modulus;

let x = 4i64.modulus(5);
assert_eq!(x, 4);

let y = -4i64.modulus(5);
assert_eq!(x, 4);

Implementors