1,000 Digits Of Pi
(Challenge added over 7 years ago.)
Calculate the first 1,000 digits of Pi.
I'm sure all of you have encountered Pi at some point or another, but I doubt many of you have tried calculating it. For this challenge, your code needs to calculate the first 1,000 digits of Pi (Not including the 3 at the start!) For reference, you can see the output we're expecting below.
There are various methods of calculating Pi, and part of the challenge will be deciding on one which is quick enough and allows you to write the smallest code. As usual, Wikipedia's Pi page is a good starting point, but be sure to make good use of Google too.
Good luck with it! Remember the IRC channel (#codegolf on irc.freenode.net) and the Forums are there if you run into difficulty!
- Your code needs to match the below output by printing to stdout. No input will be given to your code.
- Remember there is a 4-second execution limit for your code. Any code which runs for longer than 4 seconds will be deemed to have failed.