home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!demon!cix.compulink.co.uk!icdocherty
- Newsgroups: sci.math
- From: icdocherty@cix.compulink.co.uk (Ian Docherty)
- Subject: Re: Pi and math in general
- Reply-To: icdocherty@cix.compulink.co.uk
- Date: Sun, 3 Jan 1993 15:12:00 +0000
- Message-ID: <memo.837764@cix.compulink.co.uk>
- Sender: usenet@demon.co.uk
- Lines: 33
-
- In-Reply-To: Clayten_Hamacher@mindlink.bc.ca (Clayten Hamacher)
-
- TITLE: Pi and math in general
-
- > Can someone post some information on how to calculate Pi please. (preferably
- > something more precise than 22/7)
-
- The most recent method for calculating pi was used by Tamura and
- Kanada for their calculation to 16 million places.
-
- The calculation goes around an infinite loop, each time around the
- loop approximately doubles the number of correct digits. 19 times
- around the loop gives pi correct to over 1 million decimal places!
-
- INITIAL VALUES
-
- A = 1
- X = 1
- B = 1 / root(2)
- C = 1 / 4
-
- LOOP:
- Y = A
- A = (A + B) / 2
- B = root(B * Y)
- C = C - X * (A - Y) * (A - Y)
- X = 2 * X
- print the value of (A + B) * (A + B) / (4 * C)
- repeat from LOOP
-
- Where 'root' means take the square root
-
- Ian.
-