I think I should elaborate on what others have said about solving for pi. You can approximate pi/4 as accurately as your heart desires by the formula 1 - 1/3 + 1/5 - 1/7 + 1/9 ... always alternating adding and subtracting, and adding two to the denominator. Note that when you are on the adding phase you will always be slightly above pi/4, and on the subtracting phase you will always be just a little below pi/4. But if you just decide how many digits you need pi to, you can run the equation until the digits you will actually use stop changing, and are therefor accurate. Then multiply your result by 4 (because remember, this is solving for pi/4) and ta-da, pi. Here look, I wrote this C++ program to find pi:

#include "iostream.h"

int main(int argc, char* argv)
	long double pi=1;
	int denominator = 3;
	bool alt = 0;
	long double divisor;

	while (true)
		divisor = 1 / (long double)denominator;
		cout << pi*4 << " ";

		if (alt == 0)
			pi = pi - divisor;
			alt = 1;
			pi = pi + divisor;
			alt = 0;

		denominator += 2;
	return 0;

I'm no expert coder, so there is probably a way to get more digits in the output that I'm to stupid to know about, I'll update here and say so if I ever figure it out. -grin- But in the mean time, play with that.