Computing decimal digits of irrational numbers How to compute the decimal digits of irrational number(non-transcendental) with an arbitrary precision?
eg. Expansion of $\sqrt{ 2}$ with a precision of 500.  
 A: In the case of $\sqrt a$, Newton's method converges very fast:
$$
x_{n+1}=\frac12\big(x_n+\frac{a}{x_n}\big), \qquad x_0=a
$$
It doubles the number of correct digits every iteration and so to get 500 digits you'd have to do around 10 iterations. However, note that you need arbitrary precision arithmetic, at least for division and addition.
Wikipedia lists several other methods.
A: An approach I really like for $\sqrt 2$ and $\sqrt 3$ is due to Apostol. 
Note that
$$\sqrt 2 = \frac 7 5 \left(1- \frac 1 {50} \right)^{-1/2}$$
and that
$$\sqrt 3 = \frac {1732}{1000} \left(1- \frac {176} {3\,000\,000} \right)^{-1/2}$$
Using the Taylor series
$$\frac 1 {\sqrt{1-x}}=1+\frac 1 2 x+\frac 3 8 x^2+\frac 5 {16} x^3+\frac {35} {128} x^4+\frac {63} {256} x^5+\cdots$$
you can get great aproximations for such constants. Note how for $\sqrt 3$ you'll get a dramatic effect from the $3\,000\,000$ in the denominator. I think you can obtain the same with any $\sqrt r$, with a little bit of trickery, putting it as
$$\sqrt r= \frac {a}{b} \left(1- \frac {c} {d} \right)^{-1/2}$$
I'll try and find an analog for $\sqrt 5$.
For $\sqrt 5 $ you can go with
$$\sqrt 5  = \frac{{2236}}{{1000}}{\left( {1 - \frac{{304}}{{5000000}}} \right)^{ - 1/2}}$$
In general you need
$$d-c=a^2$$
$$d=rb^2$$
Just checked, and a $6^{th}$ degree polynomial gives 15 exact decimals (if more)
$$\sqrt 3  \approx 1.732050807568877$$
$$\sqrt 5 \approx 2.236067977499790$$
$$\sqrt 2 \approx  1.414213562373095$$
A: Since you're interested in algebraic numbers -- i.e. irrational numbers that are not transcendental -- there are some basic methods.
First, given a complex number, you can always take it's real and imaginary parts to reduce it to a problem of real numbers.
Sturm's theorem is a general purpose way to locate the real roots of a real polynomial. You can do a binary search to narrow down the locations of the roots.
Once you have a sufficiently good approximation, Newton's algorithm is the standard way to produce more approximations of greater accuracy.
