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

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!


gcumming said...

As a user of Linux on 'old' hardware, can I have your opinions - I have an old HP Omnibook XE2 from 2001, with a coppermine Celeron, 128MB ram and a 5gb drive. I'd like to set it up to use a 3G modem for my wife to surf the net while on maternity leave, but I'm a linux newbie. Any idea if anty of the super-light distros will do this for me 'out of the box' or am I kidding myself?

Mikko said...

I have never used a 3G modem, so I must ask my readers for comments on this one!