MCPcopy Create free account
hub / github.com/coreboot/coreboot / gcd

Function gcd

src/commonlib/bsd/gcd.c:7–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include <stdint.h>
6
7uint64_t gcd(uint64_t a, uint64_t b)
8{
9 uint64_t c;
10
11 if (a == 0 || b == 0)
12 return MAX(a, b);
13
14 c = a % b;
15
16 while (c > 0) {
17 a = b;
18 b = c;
19 c = a % b;
20 }
21
22 return b;
23}

Callers 9

permute_argsFunction · 0.85
timer_usFunction · 0.85
timer_monotonic_getFunction · 0.85
lcmFunction · 0.85
compute_frequence_ratiosFunction · 0.85
rkclk_configure_i2sFunction · 0.85
rkclk_configure_i2sFunction · 0.85
test_gcdFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_gcdFunction · 0.68