TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How Many Decimals of Pi Do We Really Need?

462 点作者 bouncingsoul大约 9 年前

30 条评论

drewolbrich大约 9 年前
If you know the diameter of the observable Universe and you want to calculate its circumference with the accuracy of the diameter of a proton, the number of digits of pi that you need is 43.
评论 #11317158 未加载
评论 #11317129 未加载
评论 #11317127 未加载
评论 #11317113 未加载
评论 #11317142 未加载
WalterBright大约 9 年前
This overlooks the issue that for repeated calculations, such as numerical integration, the trouble comes from accumulated roundoff errors. Even 16 digits of precision can become 0 digits pretty quickly if you're not very careful.
评论 #11316987 未加载
评论 #11316883 未加载
评论 #11317066 未加载
13of40大约 9 年前
According to Google NGrams, World Wars I and II both primarily used 3.1416 to represent pi.<p><a href="https:&#x2F;&#x2F;books.google.com&#x2F;ngrams&#x2F;graph?content=3.1416&amp;year_start=1800&amp;year_end=2000&amp;corpus=15&amp;smoothing=3&amp;share=&amp;direct_url=t1%3B%2C3.1416%3B%2Cc0" rel="nofollow">https:&#x2F;&#x2F;books.google.com&#x2F;ngrams&#x2F;graph?content=3.1416&amp;year_st...</a>
评论 #11317011 未加载
sharkjacobs大约 9 年前
This story is frustrating to me because it makes it sound like 15 digits of precision isn&#x27;t a lot. Fifteen isn&#x27;t a big number, but fifteen degrees of precision is almost incomprehensible.<p>If you measured your height with fifteen degrees of precision, you would have a measurement in femtometres. A femtometre is roughly the diameter of a proton.<p>That&#x27;s really precise!
sago大约 9 年前
In the &#x27;Frontiers in Astrophysics&#x27; course on Open Yale, professor Bailyn says that, for the purpose of the course, pi = 3, and pi^2 = 10.<p>Pi = 3, coincidentally, is the Hebrew Bible&#x27;s approximation too.
评论 #11317366 未加载
评论 #11316805 未加载
评论 #11317687 未加载
评论 #11317623 未加载
gunnihinn大约 9 年前
I remember back in high school physics when we were calculating the volumes of a few stars and my teacher said &quot;Just round out 4\pi&#x2F;3 to 4&quot;. I completely understand why we&#x27;d do that -- the error terms in the radius of the star completely drown out that approximation -- but goddammit it still feels wrong. I guess I&#x27;m a mathematician and not a physicist for a reason.
评论 #11318731 未加载
mchahn大约 9 年前
15 digits is about the precision hand-held calculators provide, right? Many early NASA missions took HP calculators along in missions with trajectory routines in case the computer failed.
评论 #11317084 未加载
评论 #11316832 未加载
评论 #11316849 未加载
jacobolus大约 9 年前
In this particular case, they’re just using a standard double precision IEEE 754 floating point number. So I assume they do all of their arithmetic (“for JPL&#x27;s highest accuracy calculations”) using double precision floats.
tremguy大约 9 年前
I think this is a bit of an oversimplification. You must consider compounding when talking about rounding errors. A single matrix operation with hundreds of rows and columns can easily have millions of multiplications. At every multiplication the previous error gets multiplied. That&#x27;s why I don&#x27;t feel the answer was exhaustive.
评论 #11318327 未加载
desdiv大约 9 年前
&gt;The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change.<p>Xerox Basic FORTRAN and Basic FORTRAN IV Manual[0], attributed to David H. Owens.<p>[0] <a href="https:&#x2F;&#x2F;www.textfiles.com&#x2F;bitsavers&#x2F;pdf&#x2F;sds&#x2F;sigma&#x2F;lang&#x2F;900967D_Sigma2_FORTRAN_Aug70.pdf" rel="nofollow">https:&#x2F;&#x2F;www.textfiles.com&#x2F;bitsavers&#x2F;pdf&#x2F;sds&#x2F;sigma&#x2F;lang&#x2F;90096...</a>
brandmeyer大约 9 年前
Not quite Pi, but something very closely related to Pi is retained to extremely high precision in computers.<p>libm frequently contains 2&#x2F;pi to very high precision. For example, Newlib&#x27;s math library contains 476 decimal digits of 2&#x2F;pi as part of its routines for calculating sine and cosine of numbers outside the range [-pi&#x2F;4..pi&#x2F;4].<p>See e_rem_pio2.c for more. Many of the open source math libraries are ultimately descended from the same root: the Sunpro fdlibm, archived at netlib: <a href="http:&#x2F;&#x2F;www.netlib.org&#x2F;fdlibm&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.netlib.org&#x2F;fdlibm&#x2F;</a>
评论 #11317496 未加载
gmuslera大约 9 年前
Maybe for astronomy a few could be enough, but for computing all are needed for the perfect filesystem <a href="https:&#x2F;&#x2F;github.com&#x2F;philipl&#x2F;pifs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;philipl&#x2F;pifs</a>
Houshalter大约 9 年前
The best way of looking at problems like this, is that it&#x27;s an exponential process. The number of values you can represent with n digits increases exponentially. Each additional digit increases your precision by a factor of 10. If you have 15 digits, well imagine multiplying 10 over and over again 15 times, it&#x27;s pretty big.<p>The word &quot;quadrillion&quot; is rarely used in the English language. Because it&#x27;s very rare you need numbers that large. And when you do, being off by a few digits doesn&#x27;t matter. Calculators commonly only display up to 8-10 digits, for example.<p>This applies to programming, since computers often only have a limited number of bits. Programmers often complain about floating point. One of the things about neural networks is that they don&#x27;t actually need that many bits of precision, since they are by nature very &quot;fuzzy&quot;. We can build computers that are bigger&#x2F;cheaper by sacrificing a lot of bits.<p>But one of the problems is, when adding a bunch of small numbers together, it rounds to the nearest whole number every time. And the inaccuracy builds up. So to really take advantage of less precision, we need to somehow build computers that can do <i>stochastic rounding</i>, where they sometimes round up, and sometimes round down, so the expected output is the same.
mabbo大约 9 年前
I have heard, but never done the math the verify, that with 50-ish digits of pi, one&#x27;s error on a circle the size of the Universe would be smaller than a plank length.
评论 #11317103 未加载
cnvogel大约 9 年前
The ratio of the observable universe&#x27;s circumference to a proton diameter may be 10^-35, but that doesn&#x27;t really say anything for the precision of Pi you&#x27;d need in practice for any calculation involving these scales.<p>Because for everything involving real-world data, you&#x27;ll have to measure quantities, and this is hardly ever done to more than just a few decimal digits. Whenever I want to state the circumfence of anything I know the diameter of down to single numbers of proton diameters, I first have to measure the diameter of to a precision of 1&#x2F;3 proton diameter. Only when I reach such an absurdly nonsensical precision, I&#x27;d introduce errors by using an inadequately runded value for Pi.<p>More practically: I might know that I could line up 2.611*10^25 protons (disregarding the fact that due to their charge they would repel each other) around the earth, but to calculate that I only need 5 decimal digits of the earth&#x27;s diameter, and only 5 decimal places of Pi.
albertzeyer大约 9 年前
Some other approximations: <a href="http:&#x2F;&#x2F;www.math.tamu.edu&#x2F;~dallen&#x2F;masters&#x2F;alg_numtheory&#x2F;pi.pdf" rel="nofollow">http:&#x2F;&#x2F;www.math.tamu.edu&#x2F;~dallen&#x2F;masters&#x2F;alg_numtheory&#x2F;pi.pd...</a><p>And: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Approximations_of_%CF%80" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Approximations_of_%CF%80</a><p>Babylons and early Chinese just used pi = 3.<p>Romans used pi = 3.125.
gaur大约 9 年前
Non-metric units... sigh...
bbtn大约 9 年前
Universal constants [1] have about 6-9 significant digits today. I wouldn&#x27;t use more than 10 digits of pi, if I am working on some physical calculations.<p>[1] <a href="http:&#x2F;&#x2F;physics.nist.gov&#x2F;cuu&#x2F;Constants&#x2F;index.html" rel="nofollow">http:&#x2F;&#x2F;physics.nist.gov&#x2F;cuu&#x2F;Constants&#x2F;index.html</a>
justifier大约 9 年前
i wonder if interest in measuring error of previous calculations is what encouraged this direction of computational rigor<p>respecting accuracy encourages a self awareness with an almost conscious stead ignorant error<p>i am always intrigued when it is discussed how a calculation began and the error of the initial values<p>the first known attempt at measuring the speed of light(o) had an ignorant error of ~26%<p>the first known attempt at measuring the circumference of the earth(i) had an ignorant error of ~15%<p><pre><code> &gt; our planet Earth.. the circumference .. &gt; .. would .. be if you used the limited version of pi above? &gt; It would be off by the size of a molecule. </code></pre> our conscious error is the size of a molecule, but what will our ignorant error be? how will its significance manifest?<p>the ignorant error is a result of the tools of measure, in this case observable measurements and numerical approximation<p>for those who calculated using pi equal to 22&#x2F;7, for the circumference, their error would only be ~.04% of the 15 digit rounded value<p><pre><code> &gt;&gt;&gt;2*(22&#x2F;7)*(7926&#x2F;2)&gt;&gt;&gt; 2*(22&#x2F;7)*(7926&#x2F;2) 24910.285714285714 &gt;&gt;&gt; 2*(3.141592653589793)*(7926&#x2F;2) #from the article 24900.2633723527 &gt;&gt;&gt; 24910.285714285714&#x2F;24900.2633723527 1.0004024994347707 &gt;&gt;&gt; (1.0004024994347707-1)*100 0.04024994347706645 </code></pre> (o) <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Speed_of_light#First_measurement_attempts" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Speed_of_light#First_measureme...</a><p>(i) <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Eratosthenes#Measurement_of_the_Earth.27s_circumference" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Eratosthenes#Measurement_of_th...</a><p>.. edit, percentage error, left out the *100
评论 #11317365 未加载
jstoja大约 9 年前
I really thought that the reason would have been for technical reasons, like a compromise between precision and how fast they can actually calculate with pi. The answer is simply awesome.
sunstone大约 9 年前
355&#x2F;113 gets you more than you&#x27;ll ever need.
rurban大约 9 年前
So they are using simple and fast double, not long double. Which makes sense.
julie1大约 9 年前
btw Pi = 4 (in taxicab geometry aka L1) <a href="http:&#x2F;&#x2F;math.stackexchange.com&#x2F;questions&#x2F;96835&#x2F;are-there-any-geometries-spaces-where-pi-is-a-simple-or-at-least-rational-cons" rel="nofollow">http:&#x2F;&#x2F;math.stackexchange.com&#x2F;questions&#x2F;96835&#x2F;are-there-any-...</a><p>Euclidean geometry is not the only one and some physical problems are solved using spaces in which pi is NOT 3.1459<p>;)
joss82大约 9 年前
Tl;dr: 15
dang大约 9 年前
Url changed from <a href="http:&#x2F;&#x2F;kottke.org&#x2F;16&#x2F;03&#x2F;how-many-digits-of-pi-does-nasa-use" rel="nofollow">http:&#x2F;&#x2F;kottke.org&#x2F;16&#x2F;03&#x2F;how-many-digits-of-pi-does-nasa-use</a>, which points to this.
oniMaker大约 9 年前
We need all of them. Keep going until you reach the end.
brador大约 9 年前
Miles and inches? Please learn and use standard international (SI) units. It&#x27;s important.
评论 #11317031 未加载
kordless大约 9 年前
Maybe the new decimals are information from beyond this realm. Thanks, Sagan.
hzhou321大约 9 年前
So it proves that the concept of irrational number is rather useless in practice ...
ryanobjc大约 9 年前
The real answer:<p>As many as it takes.<p>Also, what about the quest for finding the largest prime? #keepthedreamalive
评论 #11317184 未加载