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

Function reduce_rational

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

* NAME: reduce_rational() * DESCRIPTION: convert rational expression to lowest terms */

Source from the content-addressed store, hash-verified

118 * DESCRIPTION: convert rational expression to lowest terms
119 */
120static
121void reduce_rational(unsigned long *numer, unsigned long *denom)
122{
123 unsigned long factor;
124
125 factor = gcd(*numer, *denom);
126
127 assert(factor != 0);
128
129 *numer /= factor;
130 *denom /= factor;
131}
132
133/*
134 * NAME: scale_rational()

Callers 1

scale_rationalFunction · 0.85

Calls 2

gcdFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected