pow

From ZDoom Wiki
Revision as of 20:02, 20 October 2010 by Ceeb (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function computes n-th power of x.

function int pow (int x, int n)
{
	int y = 1;
	while (n-- > 0) y *= x;
	return y;
}