Skip to content

Instantly share code, notes, and snippets.

@patricksimpson
Last active March 22, 2019 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patricksimpson/e8a3a80c6882a0bcdee20c2709cafd4e to your computer and use it in GitHub Desktop.
Save patricksimpson/e8a3a80c6882a0bcdee20c2709cafd4e to your computer and use it in GitHub Desktop.
function add(x, y) {
while (y != 0) {
carry = x & y;
x = x ^ y;
y = carry << 1;
}
return x;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment