66uint32_t
gcd32(uint32_t u, uint32_t v);
93 uint32_t scaled = ((uint64_t)frac->
frac * x) >> frac->
shift;
void frac_init(frac_t *frac, uint32_t num, uint32_t den)
Initialize frac_t struct.
static uint32_t frac_scale(const frac_t *frac, uint32_t x)
Scale a 32 bit integer by a 32/32 rational number.
uint32_t gcd32(uint32_t u, uint32_t v)
Compute greatest common divisor of u and v.
frac descriptor for fraction consisting of two 32 bit integers