Skip to content

Instantly share code, notes, and snippets.

@bradcypert
Created June 22, 2017 00:30
Show Gist options
  • Save bradcypert/6dcc6e896b4747f86c5a17d5057e383a to your computer and use it in GitHub Desktop.
Save bradcypert/6dcc6e896b4747f86c5a17d5057e383a to your computer and use it in GitHub Desktop.
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