Working out digits of Pi. I have always wondered how the digits of π are calculated. How do they do it?

Thanks.

Here is one simple way to compute digits of $\pi$: 
Recall that $\tan(\pi/4) = 1$.
Thus, we have $\arctan(1) = \pi/4$.
And, in particular, $4 \cdot \arctan(1) = \pi$.
You can now take the Taylor series expansion for $4 \cdot \arctan(x)$ and consider what happens when you evaluate it at $1$. Since the corresponding series (see, e.g., here) is an alternating series decreasing in absolute value, you can evaluate however many terms you want, and then take an evaluation of the next term as a (somewhat crude) bound for your error.
