0
1
There are a lot of challenges on this site regarding pi, but none that challenge you to calculate as many digits of pi as possible.
As you all may know, pi in its decimal form goes on for infinity, so calculating it in its entirety is near to impossible. However, I challenge you to write a program in your language of choice that can calculate as many digits of pi as possible, and include an explanation with your code. The winner will be decided by popularity contest.
The only restriction is that your program cannot connect to the internet. The point is not to have your program search the internet for the most digits of pi.
So in summary, the goal is to write a program that computes as many digits of pi as possible (in decimal, so 3.14159....). Your program cannot simply connect to the internet and lookup digits, it needs to calculate it.
Note here that the goal here is to calculate as many digits as possible, but that is not the winning criteria. The winner will be based on popularity (number of upvotes). Remember, we're here to learn just as much as to have fun.
Winner will be decided on July 16 at 10 AM eastern time.
And please, don't be this guy. Let's have fun.
5What's stopping me from calculating "all" of them? (It'll take some time, I know, but there's no time constraint in your challenge.) – Martin Ender – 2014-07-09T23:06:08.527
@m.buettner Forgot to add the time constraint, you have a week to calculate them all! ;) – CailinP – 2014-07-09T23:08:41.943
2I don't have time to implement it now but maybe the BBP algorithm? The question doesn't explicitly say you have to use decimal... – baum – 2014-07-09T23:13:25.907
2In your question, you said "near to impossible". Given the universe has a finite lifespan, it IS impossible :) – aronchick – 2014-07-10T03:51:34.090
3
print "3.2"
I win, it's the law – Nick T – 2014-07-10T06:12:46.6273
This can either be "Calculate pi to arbitrary precision" as a popularity contest (pretty boring and not far off a duplicate of http://codegolf.stackexchange.com/q/506/194 ); or "Calculate as many digits of pi as possible in a given time" as [tag:fastest-code]. But at present it seems to be asking for both, which doesn't make sense.
– Peter Taylor – 2014-07-10T07:23:29.393@PeterTaylor I agree for the most part. I think 'fastest time to calculate X digits' (where X is 1M, perhaps) is just about the only variant of 'calculate pi' we haven't yet had. – primo – 2014-07-10T15:16:45.003