Previous Up Next

5.3.16  Hamming distance between sequences: hamdist

The hamdist command computes the Hamming distance between two sequences of equal lengths, which is defined to be the number of elements at same positions which do not match.

hamdist takes two arguments:

hamdist returns the number n of characters in s1 that are different than the corresponding characters in s2.

Example.


Previous Up Next