I have two contacts whose numbers differ by only the first two digits, like 98........ and 99........
Both these numbers are 10 digits long
So, when i get a call from either of these numbers, it displays the number and not the contact name.
Usually the checking is done with last digits only (I would quess its around 8 last digits normally), thus if you have numbers in internation & local format they both could be matched..
I think Nokia phones (most of them) have been checking only the last 7 digits for the last 15 years or so.
I can imagine it made some limited sense 15 years ago with much less processing power and memory in the devices. It is too bad that the same algorithm is still used in today's devices with many times more of run-time memory, storage memory and processing power.
It is not even an "algorithm": most probably "CContactIdArray *MatchPhoneNumberL(const TDesC &aNumber, TInt aMatchLengthFromRight)" method from CPbkContactEngine/CContactDatabase is used, just aMatchLengthFromRight is left as 7.