Trait malachite_base::num::logic::traits::HammingDistance
source · [−]pub trait HammingDistance<RHS = Self> {
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
fn hamming_distance(self, other: RHS) -> u64
Implementations on Foreign Types
sourceimpl HammingDistance<u8> for u8
impl HammingDistance<u8> for u8
sourcefn hamming_distance(self, other: u8) -> u64
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.
sourceimpl HammingDistance<u16> for u16
impl HammingDistance<u16> for u16
sourcefn hamming_distance(self, other: u16) -> u64
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.
sourceimpl HammingDistance<u32> for u32
impl HammingDistance<u32> for u32
sourcefn hamming_distance(self, other: u32) -> u64
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.
sourceimpl HammingDistance<u64> for u64
impl HammingDistance<u64> for u64
sourcefn hamming_distance(self, other: u64) -> u64
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.
sourceimpl HammingDistance<u128> for u128
impl HammingDistance<u128> for u128
sourcefn hamming_distance(self, other: u128) -> u64
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.
sourceimpl HammingDistance<usize> for usize
impl HammingDistance<usize> for usize
sourcefn hamming_distance(self, other: usize) -> u64
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.