Skip to content

Instantly share code, notes, and snippets.

@zuchmanski
Created February 7, 2013 18:59
Show Gist options
  • Save zuchmanski/4733248 to your computer and use it in GitHub Desktop.
Save zuchmanski/4733248 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int another_function(int x) { return !((~(~0U>>1)|x)&(x-1)); }
int main(void) {
int i;
for (i = 0; i < 256; ++i) printf("%3d: %d\n", i, another_function(i));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment