home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / sci / math / 17613 < prev    next >
Encoding:
Internet Message Format  |  1993-01-03  |  1.2 KB

  1. Path: sparky!uunet!pipex!demon!cix.compulink.co.uk!icdocherty
  2. Newsgroups: sci.math
  3. From: icdocherty@cix.compulink.co.uk (Ian Docherty)
  4. Subject: Re: Pi and math in general
  5. Reply-To: icdocherty@cix.compulink.co.uk
  6. Date: Sun, 3 Jan 1993 15:12:00 +0000
  7. Message-ID: <memo.837764@cix.compulink.co.uk>
  8. Sender: usenet@demon.co.uk
  9. Lines: 33
  10.  
  11. In-Reply-To:  Clayten_Hamacher@mindlink.bc.ca (Clayten Hamacher)
  12.  
  13.  TITLE: Pi and math in general
  14.  
  15. > Can someone post some information on how to calculate Pi please. (preferably
  16. > something more precise than 22/7)
  17.  
  18. The most recent method for calculating pi was used by Tamura and
  19. Kanada for their calculation to 16 million places.
  20.  
  21. The calculation goes around an infinite loop, each time around the
  22. loop approximately doubles the number of correct digits. 19 times
  23. around the loop gives pi correct to over 1 million decimal places!
  24.  
  25. INITIAL VALUES
  26.  
  27.         A = 1
  28.         X = 1
  29.         B = 1 / root(2)
  30.         C = 1 / 4
  31.  
  32. LOOP:
  33.         Y = A
  34.         A = (A + B) / 2
  35.         B = root(B * Y)
  36.         C = C - X * (A - Y) * (A - Y)
  37.         X = 2 * X
  38.         print the value of (A + B) * (A + B) / (4 * C)
  39.         repeat from LOOP
  40.  
  41. Where 'root' means take the square root
  42.  
  43. Ian.
  44.