Trait malachite_base::num::arithmetic::traits::ModPowerOf2IsReduced
source · [−]pub trait ModPowerOf2IsReduced {
fn mod_power_of_2_is_reduced(&self, pow: u64) -> bool;
}
Expand description
Checks whether a number is reduced modulo $2^k$.
Required Methods
fn mod_power_of_2_is_reduced(&self, pow: u64) -> bool
Implementations on Foreign Types
sourceimpl ModPowerOf2IsReduced for u8
impl ModPowerOf2IsReduced for u8
sourcefn mod_power_of_2_is_reduced(&self, pow: u64) -> bool
fn mod_power_of_2_is_reduced(&self, pow: u64) -> bool
Returns whether a number is reduced modulo another number $2^k$; in other words, whether it has no more than $k$ significant bits.
$f(x, k) = (x < 2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl ModPowerOf2IsReduced for u16
impl ModPowerOf2IsReduced for u16
sourcefn mod_power_of_2_is_reduced(&self, pow: u64) -> bool
fn mod_power_of_2_is_reduced(&self, pow: u64) -> bool
Returns whether a number is reduced modulo another number $2^k$; in other words, whether it has no more than $k$ significant bits.
$f(x, k) = (x < 2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl ModPowerOf2IsReduced for u32
impl ModPowerOf2IsReduced for u32
sourcefn mod_power_of_2_is_reduced(&self, pow: u64) -> bool
fn mod_power_of_2_is_reduced(&self, pow: u64) -> bool
Returns whether a number is reduced modulo another number $2^k$; in other words, whether it has no more than $k$ significant bits.
$f(x, k) = (x < 2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl ModPowerOf2IsReduced for u64
impl ModPowerOf2IsReduced for u64
sourcefn mod_power_of_2_is_reduced(&self, pow: u64) -> bool
fn mod_power_of_2_is_reduced(&self, pow: u64) -> bool
Returns whether a number is reduced modulo another number $2^k$; in other words, whether it has no more than $k$ significant bits.
$f(x, k) = (x < 2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl ModPowerOf2IsReduced for u128
impl ModPowerOf2IsReduced for u128
sourcefn mod_power_of_2_is_reduced(&self, pow: u64) -> bool
fn mod_power_of_2_is_reduced(&self, pow: u64) -> bool
Returns whether a number is reduced modulo another number $2^k$; in other words, whether it has no more than $k$ significant bits.
$f(x, k) = (x < 2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl ModPowerOf2IsReduced for usize
impl ModPowerOf2IsReduced for usize
sourcefn mod_power_of_2_is_reduced(&self, pow: u64) -> bool
fn mod_power_of_2_is_reduced(&self, pow: u64) -> bool
Returns whether a number is reduced modulo another number $2^k$; in other words, whether it has no more than $k$ significant bits.
$f(x, k) = (x < 2^k)$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.