CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Finding Pi

  1. #1
    Join Date
    May 1999
    Posts
    1

    Finding Pi

    Im working on Borland C++ and Im trying to figure out an algorythm for pi, but the have all failed for me. Does anyone have a function for finding Pi I could use, or at least some help to finding it? Im in desperate need!!!!!!

    Thankx in advance -- Bugg


  2. #2
    Join Date
    Apr 1999
    Posts
    18

    Re: Finding Pi

    kinda depends if you just want to know what pi is to a pretty good degree its somewhere around
    3.141592653589793238433832795
    you can also find it from calc.exe in c:\windows\
    if you want to calculate it yourself, i dont have a clue


    Of all the things I've lost I miss my mind the most

  3. #3
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Finding Pi

    Use your friendly seaech engine. I just typed in "computing PI" in altavista.com and got over 10 pages of hits.

    Regards,

    Paul McKenzie


  4. #4
    Guest

    Re: Finding Pi

    http://www.brokersys.com/snippets/#section1group11

    Various ways of computing PI to ridiculous lengths

    Spigot.C Calculate PI to ~1,000 digits using integer ma
    Pi.C Calculate PI to 8,000+ digits
    Pi8.C Another PI calculator
    Pi8.Nfo A discourse on the PI8.C algorithm
    Pi_Agm.C Calculate PI to 10's of thousands of digits




  5. #5
    Join Date
    May 1999
    Location
    Sydney, Australia
    Posts
    420

    Re: Finding Pi

    from my old school days I vaguely recall using the following:

    const double pi = 4 * ::tan(1);

    please don't quote me on it, but let me know the result
    OK?

    Sally


  6. #6
    Join Date
    Apr 1999
    Posts
    383

    Re: Finding Pi

    > ...its somewhere around
    > 3.141592653589793238433832795

    I think that should be:

    3.1415926535897932384626433832795

    if I remember correctly... :-)

    Dave

    How can I tell you I miss you, if you won't go away?


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

Featured