cog/Frameworks/GME/gme/divfix.h

19 lines
237 B
C
Raw Normal View History

2013-09-28 03:24:46 +00:00
static Uint32 DivFix(Uint32 p1, Uint32 p2, Uint32 fix)
{
Uint32 ret;
ret = p1 / p2;
p1 = p1 % p2;/* p1 = p1 - p2 * ret; */
while (fix--)
{
p1 += p1;
ret += ret;
if (p1 >= p2)
{
p1 -= p2;
ret++;
}
}
return ret;
}