Results 1 to 5 of 5

Thread: calculating Pi

  1. #1

    Thread Starter
    Frenzied Member wengang's Avatar
    Join Date
    Mar 2000
    Location
    Beijing, China
    Posts
    1,597

    calculating Pi

    Hi.
    I have read up on a number of ways to have an app calculate pi, but I keep coming back to the same hard limit. Pretty much every app I know of in Windows stops adding decimal places after about 10.
    If I wanted to calculate Pi to 1000 decimal places, the algorithm is just going to round to the nearest billionth (or whatever). What am I missing?
    How are computers getting pi into the trillions of digits?
    Wen Gang, Programmer
    VB6, QB, HTML, ASP, VBScript, Visual C++, Java

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,469

    Re: calculating Pi

    Maybe try a search for bignum?

  3. #3
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,639

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,491

    Re: calculating Pi

    Because this is more of a math question than it is a VB6 question, I have moved the thread to the Maths Forum.
    "Code is like humor. When you have to explain it, it’s bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  5. #5
    Fanatic Member VBAhack's Avatar
    Join Date
    Dec 2004
    Location
    Sector 000
    Posts
    616

    Re: calculating Pi

    Quote Originally Posted by wengang View Post
    Hi.
    I have read up on a number of ways to have an app calculate pi, but I keep coming back to the same hard limit. Pretty much every app I know of in Windows stops adding decimal places after about 10.
    If I wanted to calculate Pi to 1000 decimal places, the algorithm is just going to round to the nearest billionth (or whatever). What am I missing?
    How are computers getting pi into the trillions of digits?
    You need to use software that has extended precision capability, like the Python mpmath module, or FLINT:

    https://mpmath.org/
    https://flintlib.org/

    Years ago there was an extended precision Excel add-in called XNUMBERS that could make computations up to 200 digits or more, but development stopped at some point:

    https://www.thetropicalevents.com/Xnumbers60.htm

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