-
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 :rolleyes: (i get bored):
pi = 3.141592653589793236462643383279052884
-
Its wrong.
PI = 3.14159265358979323 8 462643383279 502884197...
This is what I memorized.
-Lou
-
lol. i guess your right :rolleyes: can anyone help me though?
-
Theres some formulas at this site.
Fun with Primes
-Hope this helps
-Lou
-
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).