Skip to content

Instantly share code, notes, and snippets.

@metallurgix
Last active August 29, 2015 14:02
Show Gist options
  • Save metallurgix/d57bef4054a00f707020 to your computer and use it in GitHub Desktop.
Save metallurgix/d57bef4054a00f707020 to your computer and use it in GitHub Desktop.
GCD
int gcd(int a, int b)
{
while(b) b ^= a ^= b ^= a %= b;
return a;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment