Function acap::hamming::hamming_distance[][src]

pub fn hamming_distance<T: PrimInt>(x: T, y: T) -> i32
Expand description

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}