How do I calculate similarity of two integers?
<p>Actually it's quite hard to describe:<br>
I want to implement an algorithm which compares figure by figure of the same position (as I do my calculations in a 10-based system it's rather the same "power of ten") of two given integers/number (with the same "length"). It should return the grade of equality as following:</p>

<ul>
<li>4491 and 1020 = 0</li>
<li>4491 and 4123 = 1</li>
<li>4491 and 4400 = 2</li>
<li>4491 and 4493 = 3</li>
<li>4491 and 4491 = 4</li>
<li>4491 and 4091 = 1</li>
</ul>

<p>I do not want to do my calculations based on a string-comparison, as I'll doing this in a way bigger scenario :)</p>
