Why NASA Only Needs Pi To So Many Decimal Places

If you’re new to the world of circular math, you might be content with referring to pi as 3.14. If you’re getting a little more busy with geometry, science, or engineering, you might have tacked on a few extra decimal places in your usual calculations. But what about the big dogs? How many decimal places do NASA use?

NASA doesn’t need this many digits. It’s likely you don’t either. Image credits: NASA/JPL-Caltech

Thankfully, the US space agency has been kind enough to answer that question. For the highest precision calculations, which are used for interplanetary navigation, NASA uses 3.141592653589793 — that’s fifteen decimal places.

The reason why is quite simple, going into any greater precision is unnecessary. The article demonstrates this by calculating the circumference of a circle with a radius equal to the distance between Earth and our most distant spacecraft, Voyager 1. Using the formula C=2pir with fifteen decimal places of pi, you’d only be off on the true circumference of the circle by a centimeter or so. On solar scales, there’s no need to go further.

Ultimately, though, you can calculate pi to a much greater precision. We’ve seen it done to 10 trillion digits, an effort which flirts with the latest Marvel movies for the title of pure irrelevance. If you’ve done it better or faster, don’t hesitate to let us know!

53 thoughts on “Why NASA Only Needs Pi To So Many Decimal Places

    1. That’s exactly what it is – as in, if you add decimals, the double value won’t change. The “off by a centimeter on the scale of the Solar System” is just a friendly description of what double precision provides.

      Of course, the funny part is that you shouldn’t be specifying pi in decimal digits anywhere, it should be specified in the format being used.

      http://mimirgames.com/articles/programming/digits-of-pi-needed-for-floating-point-numbers/

      and you definitely shouldn’t be using Doom’s version

        1. Yeah, I probably didn’t clarify that right – what I meant was you shouldn’t specify a decimal approximation to the float you plan on using, you should specify the float value directly: as in, the value of pi that’s listed here is not actually what’s in the double: it’s a decimal approximation to the double value.

          C, for instance, defines M_PI beyond this (as a decimal) to accomodate constant multiplication so you don’t drift from a “true” value, but this also means that stuff that should be completely exact in floating point isn’t depending on the compiler, and it also means it can be a bit hard to figure out exactly what value is being used.

          At the double level it really doesn’t matter because everyone just assumes part-in-2^50-ish errors are going to show up everywhere. It can be annoying if someone writes a simulator in a different language that handles the constants differently.

          But I’m a fan of actually specifying what the exact values are for readability, and any float value is exactly representable in decimal, but the reverse isn’t true (since there’s a 2 in 10 but no 5 in 2).

          1. You would need log2(5)=2.32…[to 34 digits] times as many digits to represent the binary representation of pi exactly than needed to get exact binary representation in IEEE 754. And the last 19 digits are not pi anyway. Where’s the joy in that?

  1. When I was studying numerical meteorology, I know that if I used double-precision Pi in my numerical models I’d induce enough gravity waves in a forecast to predict a snowstorm, in Florida, in July.

      1. Keeping in mind that I was a student in the late 1980s, and the easiest programming language for most of the students was QBASIC, the issue that arises is matching the precision of the incoming data with the precision of the numerical constants (of which Pi is just one of them). QBASIC at the time could be run in double-precision or single-precision mode (basically, the number of digits after a decimal point). Using 3.1415926 instead of 3.14159 caused serious problems after about 8 hours of prediction.

          1. That’s the downside to all of the rational approximations except 355/113, except even 355/113 only buys you 1 more: and it’s silly because everyone basically remembers 3.14 straight up (at the very least everyone should remember 3 straight up). There are weird mnemonic-y things to say “hey look it’s just 1/3/5 and those already exist in pi” but at that point you’ve got 5 digits already: seems like you’d be better off with a mnemonic for “26.”

    1. 355/113 has been around for a while (+50 years from one published account I can reference). And it does pretty well for many mechanical engineering conversions from [radial -to-linear] and vise-versa, like say in an automotive steering rack.

  2. Back in the days of the 4-banger calculator, I memorised pi to the 8 significant digits (plus one) that would fit on the display: 3.14159265. Worked for me until I got my HP-25. Logs, sin and cos on keys! Saved me from also having to carry a slide rule to exams. :-)

  3. From early in junior high it seems, we all (well some of us) had at least memorized PI as 3.14159 . Good enough for anything we needed to do for algebra/trig/calculus through college . Wasn’t tell recently I memorized it to a few more digits just to see if I could. Also E and the Golden Ratio. The known history of PI (and E and Golden Ratio) down through the ages is a good read (my wife goes to sleep/tunes me out when I talk about it :) ).

    As said in the article PI is only needed to a ‘few’ digits in our universe. The rest is just an academia pursuit to find the next digit… JPL/NASA uses 3.141592653589793

    Here is a good layman article on the subject:

    https://www.jpl.nasa.gov/edu/news/how-many-decimals-of-pi-do-we-really-need/

    1. Pi is a number, and yes, it can be represented as the limit of a convergent series; however, pi itself is not “converging”, as it is just a number.

      A circle has no atoms in mathematics, so the value of pi certainly has nothing to do with atoms.

    2. You didn’t mention which atoms, as hydrogen atoms are smaller than uranium, and those darn hydrogen atoms keep wandering off to pair up with another!

  4. When I was learning FORTRAN (mumble) years ago, we were taught to use

    PI = 4.0 * ATAN(1.0)

    which gives pi to the resolution of the machine (with a possible small error in the LSD due to the trigonometry).

  5. Pi is an abstract number anyways. A real life circle would have granularity at the smallest scales, so the maximum useful Pi representation I can think off, would be up to a planck unit. After that, it doesn’t apply to the physical world, just useful for flexing your math.

  6. Since pi is a ratio of circumference and diameter, everything depends on how one measures these distances accurately.
    What method is used for verification of these distances. Or which formula is used as sum of infinite series.

    Hence it is necessary to establish which formulas , methods etc need to be used to find out the value of pi.

    Without these standards, talking of value of Pi is meaningless.

    In short basis of evaluation of value of pi must be specified first.

    Dhanyavad!!!

    Prakash Lakhapate
    9867069587

  7. The Universe may have expanded a bit since I learned this data point, but awhile back I learned that a circle the circumference of the Universe can be expressed accurately with Pi to 39 decimal places. So calculating Pi to huge numbers of decimal places may be interesting and fun, but we currently need only 39 decimal places within our Universe.

  8. i think nasa’s approach here is a lot more general than pi, and i use it a lot myself.

    depending on the project, i often use several wrong estimating approaches and compare them. in the best case, maybe i’ll have a source of error so egregious that i know the number is too low, and another that is so egregious i know the number is too high. and then if the distance between those two numbers isn’t too large, i know i’ve got the problem pretty well bracketed. my point is, i don’t invest much effort in minimizing error. instead, i try to characterize it. if i got to the result “one centimeter of error out past pluto”, that’d suit me fine.

    i use this a lot in software to decide whether a numerical algorithm is ‘good enough’. every foray into fixed point starts with this kind of work. but i also use it when i’m building something physical…mostly because i know there will be slop in my implementation and i want to know if that will be a big deal. mostly, i just don’t want to do it twice (especially if the consumables are expensive or the process is time-consuming), so i want some sort of guarantee that it will work.

    i think interrogating error magnitude is one of the most important engineering principles. far more important than doing everything correctly.

  9. While not faster or better, I when I was a kid thought it was cool to calculate Pi by using a few lines of BASIC code and the random number function. I can’t recall how many decimals I could generate accurately on the school’s Commodore PET.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.