Home Forums HCL Reviews Tutorials Articles Register Search Today's Posts Mark Forums Read
 LinuxQuestions.org need help with pi calculations!
 Programming This forum is for all programming questions. The question does not have to be directly related to Linux and any language is fair game.

Notices

 01-06-2005, 06:24 PM #1 daven1 LQ Newbie   Registered: Jan 2005 Posts: 17 Rep: need help with pi calculations! Its been a while sence ive used any unix system, and im wondering if i could get some help from someone with more exp. than me. I woudnt think this would be a complicated program to make for someone with exp. I need a program that can calculate pi, but is unrestricted. Ive tried a few and there generally limited to 9m or so, i need something that can go as long as i need it too. If anyone could cook up something or tell me where to find such a program i would really appreciate it! Thanks, Daven
 01-06-2005, 07:15 PM #2 tamoneya Member   Registered: Jan 2005 Location: MA Distribution: Ubuntu 7.10 Posts: 558 Rep: Formula use this formula to calculate pi 4* (Sigma(from k=0 to n) of ((-1)^(K+1))/(2K-1) as you increase n you increase your accuracy
 01-06-2005, 07:21 PM #3 tamoneya Member   Registered: Jan 2005 Location: MA Distribution: Ubuntu 7.10 Posts: 558 Rep: Wait speed That equation may be to slow now that i think about it. You will need to have n = around 300 inorder to get two digits of accuracy. you may want to try this. pi = sqrt(6* (Sigma (from k = 1 to n) of 1/(n^2))) likewise as n increases so does accuracy