Showing posts with label dc. Show all posts
Showing posts with label dc. Show all posts

dc - A Text Mode Calculator

A few weeks ago, I wrote about bc. It can be used as a simple arbitrary precision calculator text mode and for executing mathematical programs written in bc programming language.

Today I noticed that I have yet another simple text mode calculator installed in my desktop system: dc. It is similar to bc but differs from its cousin as dc uses reverse Polish notation instead of normal mathematical notation.

For example, to add two numbers in dc you first push the numbers into stack, then enter the aritmetic operation which pops the numbers out of stack, adds them and pushes the result in stack. Finally p prints the result:

10 2.2 + p
12.2


More information about dc is provided, as usual, by info dc and man dc.

dc is a real oldie in the GNU - it predates even the C programming language. Learning dc is a way to travel back in time to an era when nobody thought computers and operating systems should be user friendly.

You should at least give dc a try, as you can always jump back to the present and continue using GNOME calculator or OpenOffice.Org calc if you really want to!