Bailey, Borwein and Plouffe

Mathematicians Bailey, Borwein and Plouffe created a formula to find the digits of pi in 1995.  As you know, pi is an irrational number which cannot be described as the sum simple of fractions.    The BBP formula is

The Task

  Write a program to calculate the first 100 digits of pi and output pi to the screen.  Use a function to calculate the last term to the power of n.  Compare the value produced with the value given to pi by your program. Don’t be put off by the equation – just break it down into simple parts and bring them back together at end.  You want to use a loop of some description to get from k = 0 to 100. Credit: Blundell@MonktonCoombe

Leave a Reply

