Results 1 to 5 of 5

Thread: pi

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Posts
    67

    Post 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

  2. #2
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    Its wrong.

    PI = 3.14159265358979323 8 462643383279 502884197...

    This is what I memorized.

    -Lou

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Posts
    67
    lol. i guess your right can anyone help me though?

  4. #4
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    Theres some formulas at this site.

    Fun with Primes

    -Hope this helps
    -Lou

  5. #5
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    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
  •  



Click Here to Expand Forum to Full Width