Need help calculating pi. Please help!

Hi, So I created this program that uses Chudnovsky's method of calculating pi and am using the data type long double. It turns out I can only calculate pi to around 20 or so decimal places acurately. I am using eclipse and was wondering if anyone knew how I could calculate up to a million or so decimal places. Thank you in advance.
Thank you for your reply, but I would really prefer using another way without using someone elses code. Does anyone know a good way to do this. I am a bit new in programming this type of stuff. Thank you all in advance.
The link I posted links to a pi calculator that uses GMP, but you can integrate GMP into your own code without using the calculator linked there.
GMP is pretty much the standard in arbitrary precision arithmetic in C. You can roll your own bignum floating point class, but it's going to be a bitch, specially if you've never done this before. Not to mention it will be very inferior compared to GMP's type.
Oh well I still really would prefer making my own bignumb class. I mean I am not too too new, but I just need an idea of where to start. I have made and array of long double and was wondering if I could store part of the number into this array and then concatenate it into a string. I was just wondering if maybe you could help explain how I could go about doing this.
Though I suppose I could use the gmp... but I have been having a bit of trouble getting it to work. I am using eclipse and min gw. Sorry for the double post but I really need to finish this calculaion really soon.
bump
Topic archived. No new replies allowed.