Skip to content

Instantly share code, notes, and snippets.

@riza
Created January 31, 2016 21:18
Show Gist options
  • Select an option

  • Save riza/3adf71bf34ed6cd111e2 to your computer and use it in GitHub Desktop.

Select an option

Save riza/3adf71bf34ed6cd111e2 to your computer and use it in GitHub Desktop.
function Compare(one,two) {
var result = 0;
while (one != 0 && two != 0) {
var d1 = one % 10;
var d2 = two % 10;
one /= 10;
two /= 10;
if (d1 == d2) {
++result;
} else {
result = 0;
}
}
if(one != 0 || two != 0)
{
console.log('Sayılar aynı uzunlukta olmalı.');
}
return result;
}
console.log(Compare(0.678615,0.820684));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment