This is where I got the formula: http://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula I have made another project to calculate pi! It is not very accurate, I am not quite sure why. But if you put the formula shown in the website above into a very accurate calculator, and you change the infinity sign to something less, it will work very well!