Talk:Dc (computer program)

This is an old revision of this page, as edited by Billyauhk (talk | contribs) at 08:08, 26 July 2011 (Optimization; Suggestion of preparing a reverse code and add to the main page). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Latest comment: 14 years ago by Billyauhk in topic Explanation
WikiProject iconSoftware: Computing Unassessed
WikiProject iconThis article is within the scope of WikiProject Software, a collaborative effort to improve the coverage of software on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
???This article has not yet received a rating on Wikipedia's content assessment scale.
???This article has not yet received a rating on the project's importance scale.
Taskforce icon
This article is supported by WikiProject Computing.

I have been unable to find any libraries of functions for 'dc' (e.g., log, sin, etc). If someone finds some, please add external links.

Wouldn't it be better to use an example that actually works? Because when I type
12 3 4 ^ + _11 / v 22 -
I get
dc: square root of negative number

Explanation

Can someone explain how the following works?
[q]sa[ln0=aln80~Psnlbx]16isb572CCB9AE9DB03273snlbxq

It encodes the email address in the hex constant n=0x572CCB9AE9DB03273 and operates on it with the macro b defined as [ln0=aln80~Psnlbx]. This recursively calls itself until n is equal to zero. -- Autopilot (talk) 22:44, 15 May 2010 (UTC)Reply
Just did a small optimization (in code length) to it: [q]sa[d0=a80~anlbx]16isb572CCB9AE9DB03273lbxq. Could anyone help writing another dc code to generate that hexadecimal number? I think it will be a good idea to add them, in pair, as an example of string handling in dc which is not yet covered by other examples. Billyauhk (talk) 08:08, 26 July 2011 (UTC)Reply

Original implementation language?

The current text says:

"It is one of the oldest Unix utilities, predating even the invention of the C programming language"

I believe that this is slightly incomplete. Wouldn't it be better to specify the original implementation language, rather than giving a hint at which one it is not? --Blazar.writeto() 14:39, 2 August 2008 (UTC)Reply

A dc prototype for PDP-7 Unix was written in B. [1][2] Dc was written in assembly in V6. [3] It was rewritten in C for V7. [4] The Plan 9 version is essentially the same as the V7 version with a few small changes to accommodate the new C compiler. 70.225.161.132 (talk) 06:27, 27 March 2011 (UTC)Reply