PCPlus 285: Calculating Pi

With the September 2009 article, I decided to present a discussion of how the constant π (pi) was calculated in antiquity and over the ages, together with a layman’s rehash of an article I’d written a while ago on how to write a program to calculate it. The nice thing about writing code to calculate π is that it shows off Machin’s formula and writing a minimal “big number” library to perform the calculation.

PCPlus logoI did come up with a fascinating fact to round off the article: it took 33 hours for a Ferranti Pegasus 1 computer to calculate 7,480 digits of π in 1957. Not only is this interesting to me because I was born in 1957, but, also because when I first started going out with my first wife in the very early 80s, she was the personal assistant to Sebastian de Ferranti, then Chairman of Ferranti Ltd. Ferranti Ltd no longer exists (it went into receivership in 1993 after a disastrous and fraudulent merger), but because of this association, and the fact that for a while Ferranti was the computer company in the UK, I have a special feeling for the name. (I even recall us being invited to the wedding of one of de Ferranti’s children: a huge do somewhere in Surrey, with the newly-weds being whisked off by helicopter.)

This article first appeared in issue 285, September 2009.

You can download the PDF here.

(I write a monthly column for PCPlus, a computer news-views-n-reviews magazine in the UK (actually there are 13 issues a year — there’s an Xmas issue as well — so it’s a bit more than monthly). The column is called Theory Workshop and appears in the Make It section of the magazine. When I signed up, my editor and the magazine were gracious enough to allow me to reprint the articles here after say a year or so.)

Loading similar posts...   Loading links to posts on similar topics...

1 Response

 avatar
#1 Bhrnjica said...
09-Nov-10 1:07 AM

Great article and algorithm too.Learned a lot from it.

I used you argolithm for PI calculation in combination of ParallelFX, wanted to show how to apply ParallelFX in some calculation.

I came to interesting results. The article is not on English, but you can see source code of the test, at the end of the article: bhrnjica.wordpress.com/.../izracunavanje-b

Regards.

Bahrudin Hrnjica

Leave a response

Note: some MarkDown is allowed, but HTML is not. Expand to show what's available.

  •  Emphasize with italics: surround word with underscores _emphasis_
  •  Emphasize strongly: surround word with double-asterisks **strong**
  •  Link: surround text with square brackets, url with parentheses [text](url)
  •  Inline code: surround text with backticks `IEnumerable`
  •  Unordered list: start each line with an asterisk, space * an item
  •  Ordered list: start each line with a digit, period, space 1. an item
  •  Insert code block: start each line with four spaces
  •  Insert blockquote: start each line with right-angle-bracket, space > Now is the time...
Preview of response