Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
int a = in0[i], b = in1[i];
int cmp = a < b; //if TRUE, cmp has all bits 1, if FALSE all bits 0
// & bitwise AND
// | bitwise OR
// ~ flips all bits
out[i] = (a&cmp) | (b&~cmp); //a when TRUE and b when FALSE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment