Created
June 22, 2017 00:30
-
-
Save bradcypert/6dcc6e896b4747f86c5a17d5057e383a to your computer and use it in GitHub Desktop.
This file contains 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 divide2(a,b,mid) { | |
let num = 0; | |
let middle = mid || a >> 1; | |
if (middle * b == a) { | |
return middle; | |
} else { | |
if (middle == 1) { | |
return 0; | |
} | |
return divide2(a, b, middle >> 1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment