Monday, March 4, 2013

RPN as desk calculator

In case you ever need a calculator on a computer, there are so many to choose from. In Windows go to the trusty calc, and in Mac go to the dashboard). Your phone has one also... although the default android one kinda sucks.

If you have a Unix prompt you can go to the "basic calculator" with bc.

I live under a rock... I have heard of "bc" in Unix but not "dc"... the desk calculator. See here for details. Ooh this thing uses Reverse-Polish-Notation! I thought only old HP calculator uses that. I love it.... that's because you solve expression by evaluating as you would by hand... without all that parantheses... The rule is simply arguments first then operation. This "dc" even predates the C programming language. Oh you can do more than just plain old calculations. It gets a bit ugly.

No comments: