|
Thread: pi
-
Jul 21st, 2001, 12:04 PM
#1
Thread Starter
Lively Member
pi
Im trying to make a program that calculates pi to a given decimal place. Im not sure the formula or how to use it. If you could please tell me the formula in VB terms and how to make it calculate. Thanks alot.
-=RAPTOR=-
I mezm0rized this much on a 30 min. car ride (i get bored):
pi = 3.141592653589793236462643383279052884
-
Jul 21st, 2001, 12:26 PM
#2
Its wrong.
PI = 3.14159265358979323 8 462643383279 502884197...
This is what I memorized.
-Lou
-
Jul 21st, 2001, 12:30 PM
#3
Thread Starter
Lively Member
lol. i guess your right can anyone help me though?
-
Jul 21st, 2001, 12:31 PM
#4
Theres some formulas at this site.
Fun with Primes
-Hope this helps
-Lou
-
Jul 21st, 2001, 01:40 PM
#5
Fanatic Member
Why bother with doing that? You'll quickly pass beyond VB's limit of precision, unless you really have the need for calculating it. 4 * Atn(1) will give you the value of Pi as close as VB will ever calculate it, unless you do it yourself. There are a bunch of ways to do it though. A lot of them look terrible, and are a pain to use unless you can look at mathmatical formulas without getting cross eyed . If you just search for pi on the net you'll come across them. Putting them into something in VB may be hard though, because of the precision thing. Your best bet might be to get digit extraction formulas, since they can get say, the Nth digit of pi without having to calculate the N-1 digits that preceed it. You could make VB do one of those, and build a string. If it's done right, it could go up to billions of digits (that's just conjecture, I've never used the formulas myself, or know if this would work or not).
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|