I tried the algorithm above, but it only seems to work for limited conditions.
An engineer explained to me how I can use the pre-existing pow() function in the <math.h> standard library.
inverseN = 1.0 / n;
x = pow(A, inverseN);
This method seems to work for a wider set of conditions.