fast gcd
int gcd(int a, int b)
{
if (a == 0)
return b;
return gcd(b % a, a);
}
fast gcd
int gcd(int a, int b)
{
if (a == 0)
return b;
return gcd(b % a, a);
}
fast gcd
unsigned int gcd(unsigned int u, unsigned int v)
{
int shift;
if (u == 0) return v;
if (v == 0) return u;
shift = __builtin_ctz(u | v);
u >>= __builtin_ctz(u);
do {
v >>= __builtin_ctz(v);
if (u > v) {
unsigned int t = v;
v = u;
u = t;
}
v = v - u;
} while (v != 0);
return u << shift;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us