[−][src]Function acap::hamming::hamming_distance
pub fn hamming_distance<T: PrimInt>(x: T, y: T) -> i32
Compute the Hamming distance between two integers.
\begin{aligned}
\mathrm{hamming\_distance}(x, y) &= |\{i \mid x_i \ne y_i\}| \\
&= \mathrm{popcount}(x \wedge y)
\end{aligned}