This is not really an answer to your question, (and perhaps this would be better posted to snippets) but here is the csh alias I wrote ages ago to be my command line calculator, that I thought you might find useful.
alias calc perl -e 'print (!*) ; '
Usage:
calc 7+7
or
calc (24+11)*(8**2)
-monkfish (The Fishy Monk)