The Best Ubuntu Calculator

December 2, 2010

Any modern operating system will come with at least some sort of calculator program. For years I’ve relied on Window’s calculator which I can bring up in just a couple of keystrokes. In Linux I’ve always just used whatever the default was for that distro, though I was never impressed with them as much as the one packaged with Windows 7. However recently I’ve been using OpenBox as my window manager and as a result I haven’t had my usual Gnome calculator at a finger’s reach. So I figured since most of the time I’m doing something in the terminal and don’t need to load up a whole GUI to crunch a couple of numbers that I’d look into some terminal based ones. After a bit of digging around I found Qalculate which installs both a GUI based calculator as well as a terminal app. How do you get it?

sudo apt-get install qalculate

After confirming your request you’ll be up and running in a few seconds. Once installed you can launch the GUI based calculator by typing qalculate into your terminal, or if you’re using Gnome or KDE you can just launch the application via your menu.

fettesps@ubuntu ~ $ qalc 9*365/4+15*27-1
((9 * 365) / 4) + (15 * 27) - 1 = 1225.25

Or if you need to do a series of calculations you can just type qalc and it will keep solving equations until you tell it to quit.

fettesps@ubuntu ~ $ qalc
> 3.33333/1.21^3

  3.33333 / (1.21^3) = approx. 1.8815779

> 9^3

  9^3 = 729

> 2<<2

  shift(2, 2) = 8

> 2<<9

  shift(2, 9) = 1024

> quit

As you can see it even did some bitwise shifting for me. Considering I didn’t even know what syntax it expected I was pretty happy with the results. To be honest I’ve bit sitting here throwing random equations at it for half the night and I haven’t been able to stump it yet. It can even calculate currencies for you!

fettesps@ubuntu ~ $ qalc
> $100 USD to CAD

  dollar * 100 * dollar = approx. 103.77108 CAD^2

> $100 CAD to AUD

  dollar * 100 * CAD = approx. 105.79388 AUD^2

> $27 AUD to GBP

  dollar * 27 * AUD = approx. 10.651537 GBP^2

> $27 AUD to EUR

  dollar * 27 * AUD = approx. 15.120906 EUR^2

> quit

Once again I didn’t use any sort of reference when punching in these commands, it was very intuitive and knew exactly what I wanted from it. I was completely guessing on the currency codes and either I got them all right except my own country, having punched in CDN instead of CAD.

So, what else can it do? How about some unit conversions? I’ll admit I usually just Google my conversions as they have a built in tool, however it seems I now can do that quicker in my terminal.

fettesps@ubuntu ~ $ qalc
> 22 inches to meters

  22 * inch = 558.8 mm

> 1/8 inch to feet

  (1 / 8) * inch = approx. 10.416667 mft

> 1 yard to meters

  1 * yard = 914.4 mm

> calories to joules

  calorie = 4.1868 J

> 1 canadian football field to an american football field

  error: "n" is not a valid variable/function/unit.
  error: "f" is not a valid variable/function/unit.
  warning: Error(s) in unitexpression.
  1 * (centiare * nanoare * day * i * are) * (foot * barn * attoliter * liter) * (0 * i * e * liter * day) = 0 aL*L*a*ca*b*d*d*ft*m^4 * am

> quit

Unfortunately, it can’t answer all of your questions…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.