MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / gcd

Function gcd

modules/data/mp3/libmad/mad_timer.c:102–114  ·  view source on GitHub ↗

* NAME: gcd() * DESCRIPTION: compute greatest common denominator */

Source from the content-addressed store, hash-verified

100 * DESCRIPTION: compute greatest common denominator
101 */
102static
103unsigned long gcd(unsigned long num1, unsigned long num2)
104{
105 unsigned long tmp;
106
107 while (num2) {
108 tmp = num2;
109 num2 = num1 % num2;
110 num1 = tmp;
111 }
112
113 return num1;
114}
115
116/*
117 * NAME: reduce_rational()

Callers 1

reduce_rationalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected