Trait malachite_base::num::arithmetic::traits::EqMod

source ·
pub trait EqMod<RHS = Self, M = Self> {
    // Required method
    fn eq_mod(self, other: RHS, m: M) -> bool;
}
Expand description

Determines whether a number is equivalent to another number modulo $m$.

Required Methods§

source

fn eq_mod(self, other: RHS, m: M) -> bool

Implementations on Foreign Types§

source§

impl EqMod for i8

source§

fn eq_mod(self, other: i8, m: i8) -> bool

Returns whether a number is equivalent to another number modulo a third; that is, whether the difference between the first two is a multiple of the third.

Two numbers are equal to each other modulo 0 iff they are equal.

$f(x, y, m) = (x \equiv y \mod m)$.

$f(x, y, m) = (\exists k \in \Z : x - y = km)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqMod for i16

source§

fn eq_mod(self, other: i16, m: i16) -> bool

Returns whether a number is equivalent to another number modulo a third; that is, whether the difference between the first two is a multiple of the third.

Two numbers are equal to each other modulo 0 iff they are equal.

$f(x, y, m) = (x \equiv y \mod m)$.

$f(x, y, m) = (\exists k \in \Z : x - y = km)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqMod for i32

source§

fn eq_mod(self, other: i32, m: i32) -> bool

Returns whether a number is equivalent to another number modulo a third; that is, whether the difference between the first two is a multiple of the third.

Two numbers are equal to each other modulo 0 iff they are equal.

$f(x, y, m) = (x \equiv y \mod m)$.

$f(x, y, m) = (\exists k \in \Z : x - y = km)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqMod for i64

source§

fn eq_mod(self, other: i64, m: i64) -> bool

Returns whether a number is equivalent to another number modulo a third; that is, whether the difference between the first two is a multiple of the third.

Two numbers are equal to each other modulo 0 iff they are equal.

$f(x, y, m) = (x \equiv y \mod m)$.

$f(x, y, m) = (\exists k \in \Z : x - y = km)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqMod for i128

source§

fn eq_mod(self, other: i128, m: i128) -> bool

Returns whether a number is equivalent to another number modulo a third; that is, whether the difference between the first two is a multiple of the third.

Two numbers are equal to each other modulo 0 iff they are equal.

$f(x, y, m) = (x \equiv y \mod m)$.

$f(x, y, m) = (\exists k \in \Z : x - y = km)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqMod for isize

source§

fn eq_mod(self, other: isize, m: isize) -> bool

Returns whether a number is equivalent to another number modulo a third; that is, whether the difference between the first two is a multiple of the third.

Two numbers are equal to each other modulo 0 iff they are equal.

$f(x, y, m) = (x \equiv y \mod m)$.

$f(x, y, m) = (\exists k \in \Z : x - y = km)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqMod for u8

source§

fn eq_mod(self, other: u8, m: u8) -> bool

Returns whether a number is equivalent to another number modulo a third; that is, whether the difference between the first two is a multiple of the third.

Two numbers are equal to each other modulo 0 iff they are equal.

$f(x, y, m) = (x \equiv y \mod m)$.

$f(x, y, m) = (\exists k \in \Z : x - y = km)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqMod for u16

source§

fn eq_mod(self, other: u16, m: u16) -> bool

Returns whether a number is equivalent to another number modulo a third; that is, whether the difference between the first two is a multiple of the third.

Two numbers are equal to each other modulo 0 iff they are equal.

$f(x, y, m) = (x \equiv y \mod m)$.

$f(x, y, m) = (\exists k \in \Z : x - y = km)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqMod for u32

source§

fn eq_mod(self, other: u32, m: u32) -> bool

Returns whether a number is equivalent to another number modulo a third; that is, whether the difference between the first two is a multiple of the third.

Two numbers are equal to each other modulo 0 iff they are equal.

$f(x, y, m) = (x \equiv y \mod m)$.

$f(x, y, m) = (\exists k \in \Z : x - y = km)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqMod for u64

source§

fn eq_mod(self, other: u64, m: u64) -> bool

Returns whether a number is equivalent to another number modulo a third; that is, whether the difference between the first two is a multiple of the third.

Two numbers are equal to each other modulo 0 iff they are equal.

$f(x, y, m) = (x \equiv y \mod m)$.

$f(x, y, m) = (\exists k \in \Z : x - y = km)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqMod for u128

source§

fn eq_mod(self, other: u128, m: u128) -> bool

Returns whether a number is equivalent to another number modulo a third; that is, whether the difference between the first two is a multiple of the third.

Two numbers are equal to each other modulo 0 iff they are equal.

$f(x, y, m) = (x \equiv y \mod m)$.

$f(x, y, m) = (\exists k \in \Z : x - y = km)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl EqMod for usize

source§

fn eq_mod(self, other: usize, m: usize) -> bool

Returns whether a number is equivalent to another number modulo a third; that is, whether the difference between the first two is a multiple of the third.

Two numbers are equal to each other modulo 0 iff they are equal.

$f(x, y, m) = (x \equiv y \mod m)$.

$f(x, y, m) = (\exists k \in \Z : x - y = km)$.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Implementors§