Trait malachite_base::num::arithmetic::traits::EqMod
source · [−]Expand description
Determines whether a number is equivalent to another number modulo $m$.
Required Methods
Implementations on Foreign Types
sourceimpl EqMod<u8, u8> for u8
impl EqMod<u8, u8> for u8
sourcefn eq_mod(self, other: u8, m: u8) -> bool
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.
sourceimpl EqMod<u16, u16> for u16
impl EqMod<u16, u16> for u16
sourcefn eq_mod(self, other: u16, m: u16) -> bool
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.
sourceimpl EqMod<u32, u32> for u32
impl EqMod<u32, u32> for u32
sourcefn eq_mod(self, other: u32, m: u32) -> bool
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.
sourceimpl EqMod<u64, u64> for u64
impl EqMod<u64, u64> for u64
sourcefn eq_mod(self, other: u64, m: u64) -> bool
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.
sourceimpl EqMod<u128, u128> for u128
impl EqMod<u128, u128> for u128
sourcefn eq_mod(self, other: u128, m: u128) -> bool
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.
sourceimpl EqMod<usize, usize> for usize
impl EqMod<usize, usize> for usize
sourcefn eq_mod(self, other: usize, m: usize) -> bool
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.
sourceimpl EqMod<i8, i8> for i8
impl EqMod<i8, i8> for i8
sourcefn eq_mod(self, other: i8, m: i8) -> bool
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.
sourceimpl EqMod<i16, i16> for i16
impl EqMod<i16, i16> for i16
sourcefn eq_mod(self, other: i16, m: i16) -> bool
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.
sourceimpl EqMod<i32, i32> for i32
impl EqMod<i32, i32> for i32
sourcefn eq_mod(self, other: i32, m: i32) -> bool
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.
sourceimpl EqMod<i64, i64> for i64
impl EqMod<i64, i64> for i64
sourcefn eq_mod(self, other: i64, m: i64) -> bool
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.
sourceimpl EqMod<i128, i128> for i128
impl EqMod<i128, i128> for i128
sourcefn eq_mod(self, other: i128, m: i128) -> bool
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.
sourceimpl EqMod<isize, isize> for isize
impl EqMod<isize, isize> for isize
sourcefn eq_mod(self, other: isize, m: isize) -> bool
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.