# Terminal Calculations

Qalculate! is a well known GTK-based GUI calculator. For years I ignored it because I failed to realize that it included a terminal interface, `qalc`. Since learning about `qalc` last year it has become my go-to calculator. It supports all the same features as the GUI, including RPN and unit conversions. I primarily use GNU Units for unit wrangling, but being able to perform unit conversions within my calculator is sometimes useful.

``````\$ qalc
> 1EUR to USD
It has been 20 day(s) since the exchange rates last were updated
Do you wish to update the exchange rates now? y

1 * euro = approx. \$1.1137000

> 32oC to oF

32 * celsius = 89.6 oF
``````

The RPN mode is not quite as intuitive as a purpose built RPN calculator like Orpie, but it is adequate for my uses. My most frequent use of RPN mode is totaling a long list of numbers without bothering with all those tedious `+` symbols.

``````> rpn on
> stack
The RPN stack is empty
> 85

85 = 85

> 42

42 = 42

> 198

198 = 198

> 5

5 = 5

> 659

659 = 659

> stack

1:    659
2:    5
3:    198
4:    42
5:    85

> total

total([659, 5, 198, 42, 85]) = 989

> stack

1:    989
``````

Also provided are some basic statistics functions that can help save time.

``````> mean(2,12,5,3,1)
mean([2, 12, 5, 3, 1]) = 4.6
``````

And of course there are the varaibles and constants you would expect

``````> 12+3*8)/2
(12 + (3 * 8)) / 2 = 18
> ans*pi
ans * pi = 56.548668
``````

I reach for `qalc` more frequently than alternative calculators like bc, insect, or the Python shell.