Created
January 31, 2016 21:18
-
-
Save riza/3adf71bf34ed6cd111e2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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