Skip to main content

ModIsReduced

Trait ModIsReduced 

Source
pub trait ModIsReduced<M = Self> {
    // Required method
    fn mod_is_reduced(&self, m: &M) -> bool;
}
Expand description

Checks whether a number is reduced modulo another number $m$.

Required Methods§

Source

fn mod_is_reduced(&self, m: &M) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ModIsReduced for u8

Source§

fn mod_is_reduced(&self, m: &u8) -> bool

Returns whether a number is reduced modulo another number $m$; in other words, whether it is less than $m$. $m$ cannot be zero.

$f(x, m) = (x < m)$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if $m$ is 0.

§Examples

See here.

Source§

impl ModIsReduced for u16

Source§

fn mod_is_reduced(&self, m: &u16) -> bool

Returns whether a number is reduced modulo another number $m$; in other words, whether it is less than $m$. $m$ cannot be zero.

$f(x, m) = (x < m)$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if $m$ is 0.

§Examples

See here.

Source§

impl ModIsReduced for u32

Source§

fn mod_is_reduced(&self, m: &u32) -> bool

Returns whether a number is reduced modulo another number $m$; in other words, whether it is less than $m$. $m$ cannot be zero.

$f(x, m) = (x < m)$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if $m$ is 0.

§Examples

See here.

Source§

impl ModIsReduced for u64

Source§

fn mod_is_reduced(&self, m: &u64) -> bool

Returns whether a number is reduced modulo another number $m$; in other words, whether it is less than $m$. $m$ cannot be zero.

$f(x, m) = (x < m)$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if $m$ is 0.

§Examples

See here.

Source§

impl ModIsReduced for u128

Source§

fn mod_is_reduced(&self, m: &u128) -> bool

Returns whether a number is reduced modulo another number $m$; in other words, whether it is less than $m$. $m$ cannot be zero.

$f(x, m) = (x < m)$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if $m$ is 0.

§Examples

See here.

Source§

impl ModIsReduced for usize

Source§

fn mod_is_reduced(&self, m: &usize) -> bool

Returns whether a number is reduced modulo another number $m$; in other words, whether it is less than $m$. $m$ cannot be zero.

$f(x, m) = (x < m)$.

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if $m$ is 0.

§Examples

See here.

Implementors§