Trait malachite_base::num::arithmetic::traits::DivisibleBy
source · [−]pub trait DivisibleBy<RHS = Self> {
fn divisible_by(self, other: RHS) -> bool;
}
Expand description
Determines whether a number is divisible by another number.
Required Methods
fn divisible_by(self, other: RHS) -> bool
Implementations on Foreign Types
sourceimpl DivisibleBy<u8> for u8
impl DivisibleBy<u8> for u8
sourcefn divisible_by(self, other: u8) -> bool
fn divisible_by(self, other: u8) -> bool
Returns whether a number is divisible by another number; in other words, whether the first number is a multiple of the second.
This means that zero is divisible by any number, including zero; but a nonzero number is never divisible by zero.
$f(x, m) = (m|x)$.
$f(x, m) = (\exists k \in \N : x = km)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleBy<u16> for u16
impl DivisibleBy<u16> for u16
sourcefn divisible_by(self, other: u16) -> bool
fn divisible_by(self, other: u16) -> bool
Returns whether a number is divisible by another number; in other words, whether the first number is a multiple of the second.
This means that zero is divisible by any number, including zero; but a nonzero number is never divisible by zero.
$f(x, m) = (m|x)$.
$f(x, m) = (\exists k \in \N : x = km)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleBy<u32> for u32
impl DivisibleBy<u32> for u32
sourcefn divisible_by(self, other: u32) -> bool
fn divisible_by(self, other: u32) -> bool
Returns whether a number is divisible by another number; in other words, whether the first number is a multiple of the second.
This means that zero is divisible by any number, including zero; but a nonzero number is never divisible by zero.
$f(x, m) = (m|x)$.
$f(x, m) = (\exists k \in \N : x = km)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleBy<u64> for u64
impl DivisibleBy<u64> for u64
sourcefn divisible_by(self, other: u64) -> bool
fn divisible_by(self, other: u64) -> bool
Returns whether a number is divisible by another number; in other words, whether the first number is a multiple of the second.
This means that zero is divisible by any number, including zero; but a nonzero number is never divisible by zero.
$f(x, m) = (m|x)$.
$f(x, m) = (\exists k \in \N : x = km)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleBy<u128> for u128
impl DivisibleBy<u128> for u128
sourcefn divisible_by(self, other: u128) -> bool
fn divisible_by(self, other: u128) -> bool
Returns whether a number is divisible by another number; in other words, whether the first number is a multiple of the second.
This means that zero is divisible by any number, including zero; but a nonzero number is never divisible by zero.
$f(x, m) = (m|x)$.
$f(x, m) = (\exists k \in \N : x = km)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleBy<usize> for usize
impl DivisibleBy<usize> for usize
sourcefn divisible_by(self, other: usize) -> bool
fn divisible_by(self, other: usize) -> bool
Returns whether a number is divisible by another number; in other words, whether the first number is a multiple of the second.
This means that zero is divisible by any number, including zero; but a nonzero number is never divisible by zero.
$f(x, m) = (m|x)$.
$f(x, m) = (\exists k \in \N : x = km)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleBy<i8> for i8
impl DivisibleBy<i8> for i8
sourcefn divisible_by(self, other: i8) -> bool
fn divisible_by(self, other: i8) -> bool
Returns whether a number is divisible by another number; in other words, whether the first number is a multiple of the second.
This means that zero is divisible by any number, including zero; but a nonzero number is never divisible by zero.
$f(x, m) = (m|x)$.
$f(x, m) = (\exists k \in \Z : \ x = km)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleBy<i16> for i16
impl DivisibleBy<i16> for i16
sourcefn divisible_by(self, other: i16) -> bool
fn divisible_by(self, other: i16) -> bool
Returns whether a number is divisible by another number; in other words, whether the first number is a multiple of the second.
This means that zero is divisible by any number, including zero; but a nonzero number is never divisible by zero.
$f(x, m) = (m|x)$.
$f(x, m) = (\exists k \in \Z : \ x = km)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleBy<i32> for i32
impl DivisibleBy<i32> for i32
sourcefn divisible_by(self, other: i32) -> bool
fn divisible_by(self, other: i32) -> bool
Returns whether a number is divisible by another number; in other words, whether the first number is a multiple of the second.
This means that zero is divisible by any number, including zero; but a nonzero number is never divisible by zero.
$f(x, m) = (m|x)$.
$f(x, m) = (\exists k \in \Z : \ x = km)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleBy<i64> for i64
impl DivisibleBy<i64> for i64
sourcefn divisible_by(self, other: i64) -> bool
fn divisible_by(self, other: i64) -> bool
Returns whether a number is divisible by another number; in other words, whether the first number is a multiple of the second.
This means that zero is divisible by any number, including zero; but a nonzero number is never divisible by zero.
$f(x, m) = (m|x)$.
$f(x, m) = (\exists k \in \Z : \ x = km)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleBy<i128> for i128
impl DivisibleBy<i128> for i128
sourcefn divisible_by(self, other: i128) -> bool
fn divisible_by(self, other: i128) -> bool
Returns whether a number is divisible by another number; in other words, whether the first number is a multiple of the second.
This means that zero is divisible by any number, including zero; but a nonzero number is never divisible by zero.
$f(x, m) = (m|x)$.
$f(x, m) = (\exists k \in \Z : \ x = km)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl DivisibleBy<isize> for isize
impl DivisibleBy<isize> for isize
sourcefn divisible_by(self, other: isize) -> bool
fn divisible_by(self, other: isize) -> bool
Returns whether a number is divisible by another number; in other words, whether the first number is a multiple of the second.
This means that zero is divisible by any number, including zero; but a nonzero number is never divisible by zero.
$f(x, m) = (m|x)$.
$f(x, m) = (\exists k \in \Z : \ x = km)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.