home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / programm / 3556 < prev    next >
Encoding:
Internet Message Format  |  1993-01-23  |  1.3 KB

  1. Path: sparky!uunet!cs.utexas.edu!swrinde!emory!ogicse!qiclab!leonard
  2. From: leonard@qiclab.scn.rain.com (Leonard Erickson)
  3. Newsgroups: comp.programming
  4. Subject: Re: how to calculate PI
  5. Message-ID: <1993Jan23.080718.24306@qiclab.scn.rain.com>
  6. Date: 23 Jan 93 08:07:18 GMT
  7. Article-I.D.: qiclab.1993Jan23.080718.24306
  8. References: <peterd.727508100@tscc2> <LOWRY.93Jan20104500@rotor.watson.ibm.com> <c8h3xpm@rpi.edu>
  9. Reply-To: Leonard.Erickson@f51.n105.z1.fidonet.org
  10. Organization: SCN Research/Qic Laboratories of Tigard, Oregon.
  11. Lines: 24
  12.  
  13. rogerj@aix.rpi.edu (Diversion (Jeff Rogers)) writes:
  14.  
  15. >lowry@watson.ibm.com (Andy Lowry) writes:
  16.  
  17. >>In article <peterd.727508100@tscc2> peterd@tscc2.macarthur.uws.edu.au () writes:
  18. >> > Anyone out there have an algorithm for calculating PI ?
  19.  
  20. >>One of the coolest formulas I've seen in Gregory's formula:
  21.  
  22. >>  pi/4 = 4*atan(1/5)-atan(1/239)
  23.  
  24. >Why not just 
  25. >   pi/4=atan(1)? 
  26.  
  27. On several different machines I've found that 2*atan(maxreal) gives
  28. a more accurate value for pi than 4*atan(1). And you don't really need
  29. to be *that* accurate in the value for "maxreal". 1e[max exponent]
  30. works fine.
  31.  
  32. -- 
  33. Leonard Erickson              leonard@qiclab.scn.rain.com
  34. CIS: [70465,203]             70465.203@compuserve.com
  35. FIDO:   1:105/51     Leonard.Erickson@f51.n105.z1.fidonet.org
  36. (The CIS & Fido addresses are preferred)
  37.