LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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


Reply
  Search this Thread
Old 01-06-2005, 06:24 PM   #1
daven1
LQ Newbie
 
Registered: Jan 2005
Posts: 17

Rep: Reputation: 0
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
 
Old 01-06-2005, 07:15 PM   #2
tamoneya
Member
 
Registered: Jan 2005
Location: MA
Distribution: Ubuntu 7.10
Posts: 558

Rep: Reputation: 31
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
 
Old 01-06-2005, 07:21 PM   #3
tamoneya
Member
 
Registered: Jan 2005
Location: MA
Distribution: Ubuntu 7.10
Posts: 558

Rep: Reputation: 31
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
threads for mathematical calculations? skywalker27182 Programming 3 02-13-2005 10:25 AM
rough MySQL size calculations? benbroad Linux - Software 2 12-02-2004 06:01 AM
Date calculations in BASH script Crashman Programming 4 07-03-2004 10:15 AM
EIGRP and IGRP metric calculations dai Linux - Networking 1 12-16-2002 02:59 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration