home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / c / 12571 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  1.6 KB

  1. Path: sparky!uunet!seismo!darwin.sura.net!nih-csl!alw.nih.gov!gregh
  2. From: gregh@alw.nih.gov (Gregory Humphreys)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: POWER OF LARGE NUMBERS
  5. Message-ID: <1992Aug20.140151.20492@alw.nih.gov>
  6. Date: 20 Aug 92 14:01:51 GMT
  7. References: <1992Aug12.135106.12924@cs.uow.edu.au> <thompson.713734408@daphne.socsci.umn.edu> <1992Aug16.052157.1991@organpipe.uug.arizona.edu> <1992Aug17.222948.10070@merlin.dev.cdx.mot.com> <CGAY.92Aug17223208@majestix.cs.uoregon.edu> <1992Aug19.142921.27592@crpmks
  8. Sender: postman@alw.nih.gov (AMDS Postmaster)
  9. Organization: National Inst. of Health, DCRT, CSL
  10. Lines: 27
  11.  
  12. In article <1992Aug19.142921.27592@crpmks.uucp>, billb@crpmks.uucp (Bill Bochnik (Info Systems)) writes:
  13. |> Just for amusement, what was the repeating formula for calculating PI to any 
  14. |> desired number of digits?  Thanks.
  15. |> 
  16. |> -- 
  17. |> Bill Bochnik            | It's hard to be a James Bond in an Abbott
  18. |> Systems Analyst         |    and Costello world.
  19. |> Ciba-Geigy Corporation        | Signed and sealed, they deliver oblivion.
  20. |> philabs!crpmks!billb        | It's worse than that, he's dead Jim.
  21.  
  22. There's the simple one from the taylor series for (arctan?):
  23.  
  24. P I         1   1   1   1   
  25. ---  =  1 - - + - - - + - - ...
  26.  4          3   5   7   9    
  27.  
  28. Don't yell at me if ther's a better way, I know there is.  This converges really slowly, tho.  The best way is to Use Mathematica:
  29.  
  30.  
  31.  
  32. N[Pi,Num_Digits]
  33.  
  34. -- 
  35. Greg Humphreys    |  "Playing not to win is like sleeping with your 
  36. gregh@alw.nih.gov |  sister - sure, she's a great piece of tail, 
  37.                   |  and she's got a bag full of goodies, but it's 
  38. (301) 402-1817    |  just plain illegal."  -Charlie Sheen, "Hotshots"
  39.