dc
is the Unix standard desktop calculator. AFAIK, there are different implementations (like Solaris or GNU for instance).
What is the exact difference between these implementations and what is t开发者_运维问答he minimal subset of operations you can be sure a dc
implementation has?
As far as I could find, at least FreeBSD used to use the GNU-Implementation as well,1 but doesn't do so anymore. Solaris seems to have a different Implementation.2 From my first read, I mentiones these things:
Solaris dc lacks these commands
|
,a
,~
,n
,Solaris lacks the commands
!=
,!>
and!<
. This is important, because it changes the way shell commands are evaluated. In GNU dc, the sequence!>...
is applying the comparison, but in Solaris this would execute the rest of the line as a shell command.Solaris lacks support of
#
comments.In Solaris,
Y
prints additional debuging information.Solaris does not accept any command-line arguments.
GNU dc accepts input radices up to 16, Solaris seems to be unlimited (unshure).
精彩评论