Skip to content

Instantly share code, notes, and snippets.

@nullableVoidPtr
Last active August 4, 2019 09:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
#include <stdio.h>
unsigned char gcd256(unsigned char a) {
for (int i = 0; i < 8; i++) if ((a >> i) & 1) return 1 << i;
}
int main() {
for (int i = 0; i < 256; i++) printf("%d\n", gcd256(i));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment