Weird but true pow(x,y) function

darudude, there is no tail-recursion optimization in C. Call a function, more stack is consumed. At some point, the stack will grow so large it overwrites your non-stack variables, or vice versa, and kaboom.

long powint(int factor, unsigned int exponent)
{
    long product = 1;
    while (exponent--)
       product *= factor;
    return product;
}