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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

A deeper introduction to Unix DC

72 点作者 ben165将近 5 年前

7 条评论

arexxbifs将近 5 年前
Related fun fact: bc is a dc preprocessor[0].<p>[0] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Bc_(programming_language)#History" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Bc_(programming_language)#Hist...</a>
staycoolboy将近 5 年前
I love reading examples of these &quot;great-great-grandparent&quot; applications hidden in &#x2F;bin. I&#x27;ve used dc in shell scripts for years, but for the simplest of simple computations (e.g., automating FDISK partitioning and doing sector math). Had no idea it could do this.<p>TIL this and a cool CSS trick.
c0l0将近 5 年前
dc is worth having installed because of this CLI gem alone:<p><pre><code> echo &quot;[q]sa[ln0=aln256%Pln256&#x2F;snlbx]sb729901041524823122snlbxq&quot; | dc </code></pre> I&#x27;ve never tried to understand what&#x27;s really going on to produce the result, but also wouldn&#x27;t really know where to start - maybe someone in HN&#x27;s audience can enlighten me? :)
评论 #23456372 未加载
评论 #23460417 未加载
评论 #23457187 未加载
评论 #23463508 未加载
Hitton将近 5 年前
Funny. Despite being long time Linux user this is the first time I remember hearing about dc. I only knew bc.
评论 #23463517 未加载
seryoiupfurds将近 5 年前
<p><pre><code> [Monte Carlo approximation of Pi. Registers: u - routine : execute i if sum of squares less than 1 i - routine : increment register x z - routine : iterator - execute u while n &gt; m++ r - routine : RANDU PRNG m - variable: number of samples x - variable: number of samples inside circle s - variable: seed for r k - variable: scale for division n - variable: number of iterations (user input) ]c [lrx 2^ lrx 2^ + 1&gt;i]su [lx 1+ sx]si [lu x lm 1+ d sm ln&gt;z]sz [0k ls 65539 * 2 31^ % d ss lkk 2 31 ^ &#x2F;]sr ? sn 5dksk 1 ss lzx lx lm &#x2F; 4* p $ dc pi.dc 100000 3.13372</code></pre>
azizsaya将近 5 年前
Aah! command I encounter and ignore when I mistype cd
评论 #23468782 未加载
082349872349872将近 5 年前
6581840dnP
评论 #23457014 未加载