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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Calculating Pi in 5 lines of Python

1 点作者 swagasaurus-rex3 个月前

2 条评论

westurner3 个月前
&gt; <i>Infinite series can&#x27;t really be calculated to completion using a computer,</i><p>The sum of an infinite <i>divergent</i> series cannot be calculated with or without a computer.<p>The sum of an infinite <i>convergent</i> series can be calculated with:<p><pre><code> 1&#x2F;(a-r) </code></pre> Sequence &gt; Limits and convergence: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Sequence#Limits_and_convergence" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Sequence#Limits_and_convergenc...</a><p>Limit of a sequence: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Limit_of_a_sequence" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Limit_of_a_sequence</a><p>SymPy docs &gt; Limits of Sequences: <a href="https:&#x2F;&#x2F;docs.sympy.org&#x2F;latest&#x2F;modules&#x2F;series&#x2F;limitseq.html" rel="nofollow">https:&#x2F;&#x2F;docs.sympy.org&#x2F;latest&#x2F;modules&#x2F;series&#x2F;limitseq.html</a><p>&gt; <i>Provides methods to compute limit of terms having sequences at infinity.</i><p>Madhava-Leibniz formula for π: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Leibniz_formula_for_%CF%80" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Leibniz_formula_for_%CF%80</a>
chrism2383 个月前
And how thousands of lines of C, below, to actually get the work done?