Skip to content

Instantly share code, notes, and snippets.

@patricksimpson patricksimpson/add.js
Last active Mar 22, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.