Hi Frank,
I assume you are talking about distance calculations used in HTM algorithms like spatial pooling and temporal memory; specifically how neurons (via dendrite segments) match an input bit array, or previous state. The original specification of these algorithms uses overlap, the number of “on” bits matching.
I actually think this is a theory question, not just an implementation question. So I suggest this topic is in the wrong category here. And note I did just post on this topic at Positive-only matching vs negative matching.