Trait num_prime::BitTest

source ·
pub trait BitTest {
    // Required methods
    fn bits(&self) -> usize;
    fn bit(&self, position: usize) -> bool;
    fn trailing_zeros(&self) -> usize;
}
Expand description

This trait support unified bit testing for (unsigned) integers

Required Methods§

source

fn bits(&self) -> usize

Get the minimum required number of bits to represent this integer

source

fn bit(&self, position: usize) -> bool

Get the i-th bit of the integer, with i specified by position

source

fn trailing_zeros(&self) -> usize

Get the number of trailing zeros in the integer

Implementations on Foreign Types§

source§

impl BitTest for u8

source§

fn bits(&self) -> usize

source§

fn bit(&self, position: usize) -> bool

source§

fn trailing_zeros(&self) -> usize

source§

impl BitTest for u16

source§

fn bits(&self) -> usize

source§

fn bit(&self, position: usize) -> bool

source§

fn trailing_zeros(&self) -> usize

source§

impl BitTest for u32

source§

fn bits(&self) -> usize

source§

fn bit(&self, position: usize) -> bool

source§

fn trailing_zeros(&self) -> usize

source§

impl BitTest for u64

source§

fn bits(&self) -> usize

source§

fn bit(&self, position: usize) -> bool

source§

fn trailing_zeros(&self) -> usize

source§

impl BitTest for u128

source§

fn bits(&self) -> usize

source§

fn bit(&self, position: usize) -> bool

source§

fn trailing_zeros(&self) -> usize

source§

impl BitTest for usize

source§

fn bits(&self) -> usize

source§

fn bit(&self, position: usize) -> bool

source§

fn trailing_zeros(&self) -> usize

source§

impl BitTest for BigUint

source§

fn bit(&self, position: usize) -> bool

source§

fn bits(&self) -> usize

source§

fn trailing_zeros(&self) -> usize

Implementors§

source§

impl<T: Integer + Clone + BitTest, R: Reducer<T>> BitTest for Mint<T, R>