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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: Happy Pi day with this PWA to cut 100k Pi digits offline

1 点作者 imcotton大约 1 年前
It using JavaScript native BigInt and Chudnovsky Algorithm ([wiki]), the code was taken from one of the examples in the QuickJS project ([quickjs&#x2F;pi], [pi_bigint.js]).<p>The syntax for cutting:<p><pre><code> pi#6 &#x2F;&#x2F; take 6 digits of Pi (314_159) pi#6#3 &#x2F;&#x2F; take 6 digits of Pi but drop 3 beforehand (159_265) pi#1#40000 &#x2F;&#x2F; take one digit at 40,000th </code></pre> It uses service workers to cache static files, by the time it opens up you already free to be offline, try toggle network switch to verify.<p>It has download link at bottom of the about page ([accdoo.app&#x2F;about]) which you could then self host it by dropping into any static hosting services.<p>btw, the Pi feature was by-product from the original App but I won&#x27;t expand here, if you&#x27;d like to learn more, please checkout its Show HN post (39115559, 39138957 and 39238295) previously.<p>[wiki]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Chudnovsky_algorithm" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Chudnovsky_algorithm</a><p>[quickjs&#x2F;pi]: <a href="https:&#x2F;&#x2F;bellard.org&#x2F;quickjs&#x2F;pi.html" rel="nofollow">https:&#x2F;&#x2F;bellard.org&#x2F;quickjs&#x2F;pi.html</a><p>[pi_bigint.js]: <a href="https:&#x2F;&#x2F;github.com&#x2F;bellard&#x2F;quickjs&#x2F;blob&#x2F;master&#x2F;examples&#x2F;pi_bigint.js">https:&#x2F;&#x2F;github.com&#x2F;bellard&#x2F;quickjs&#x2F;blob&#x2F;master&#x2F;examples&#x2F;pi_b...</a><p>[accdoo.app&#x2F;about]: <a href="https:&#x2F;&#x2F;accdoo.app&#x2F;about#releases" rel="nofollow">https:&#x2F;&#x2F;accdoo.app&#x2F;about#releases</a><p>[39115559]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=39115559">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=39115559</a><p>[39138957]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=39138957">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=39138957</a><p>[39238295]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=39238295">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=39238295</a>

暂无评论

暂无评论