Trait malachite_base::num::logic::traits::HammingDistance

source ·
pub trait HammingDistance<RHS = Self> {
    // Required method
    fn hamming_distance(self, other: RHS) -> u64;
}
Expand description

Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.

Required Methods§

source

fn hamming_distance(self, other: RHS) -> u64

Implementations on Foreign Types§

source§

impl HammingDistance for u8

source§

fn hamming_distance(self, other: u8) -> u64

Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl HammingDistance for u16

source§

fn hamming_distance(self, other: u16) -> u64

Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl HammingDistance for u32

source§

fn hamming_distance(self, other: u32) -> u64

Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl HammingDistance for u64

source§

fn hamming_distance(self, other: u64) -> u64

Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl HammingDistance for u128

source§

fn hamming_distance(self, other: u128) -> u64

Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

source§

impl HammingDistance for usize

source§

fn hamming_distance(self, other: usize) -> u64

Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.

§Worst-case complexity

Constant time and additional memory.

§Examples

See here.

Implementors§