quick calc

November 2, 2006 under Firefox, Google, Hacks, Python, Ruby

Often, I need to do some quick arithmetic involving multiple operations and don’t have a good calculator handy. There’s a calculator application on my cell phone, but I’m an atrociously slow cell phone typer. Most simple calculator apps, like calc.exe in Windows, are fine for single operations like 2+2 or 67 * 1.14, but for multiple-operation expressions, those simple apps won’t cut it without needing to resort to some copy ‘n’ pasting or [gasp] manual jotting with a writing utensil.

When I’m in front of a computer and I need to quickly calculate an arithmetic expression to figure out sales tax, find averages, multiply numbers too large for my brain to deal with, etc, writing a script or a total application would be overkill. Here are the cross-platform solutions that I find myself resorting to:

Python (python.org)
Python's IDLE
Python’s interpreter is convenient. It allows you to enter any mathematical express and it will evaluate it as if it were a line in a Python script. You could even assign values to variables or other data structures, use loops, conditions, and create functions like you would in any ol’ script.

Ruby (ruby-lang.org)
Ruby's IRB
Ruby’s interpreter has nearly identical features to Python’s interpreter, except that the language is Ruby instead of Python…duh 😉

Mozilla Firefox JavaScript Error Console (mozilla.org/firefox/)
In Firefox, selecting “Error Console” from the Tools menu item will launch the JavaScript Error Console window. The Error Console is useful for debugging JavaScript in Web applications. However, much like Python’s and Ruby’s interpreter, it too can quickly evaluate arithmetic expressions. Its main shortcoming, when compared to the aforementioned Python and Ruby interpreters, is that can only evaluate one line at a time. So you cannot store data in variables, since once you click the evaluate button, your variables are destroyed.
Firefox's JavaScript Error Console

Google (google.com)
Google’s powerful searching abilities are one thing, but did you know that it can also perform calculations (Ex: (99*66)2), unit conversions (Ex: 120 kilometres in miles) and even unit+currency conversion (Ex: help the in laws figure out Canadian gas prices ).

Instacalc (instacalc.com)
I’ve just recently come across this website and haven’t explored all of the features yet. However, it looks very promising. Using AJAX to display answers as you type in your expression is a nice touch.

For Windows users, there’s also the Power Calculator that’s part of the suite of Windows XP PowerToys. I keep it bound to the Calculator key on my keyboard.

better calculators + me = happy

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 1 »