Whole books have been written about Applescript and Services, so if you find something like this convenient, you may want to look into Snow Leopard’s greatly overhauled Automator, Applescript and Services menu features and see if you can make a tool for yourself.

]]>5/0 … results in divByZero,

3+2*5 … results in 13,

(3+2)*5 … results in 25,

5! … results in 120,

cos(1) … results in 0,

tan(pi) … results in 0,

sin(pi/2) … results in 1,

pow(2,3) … results in 8,

sqrt(121) … results in 11,

log(1000) … results in 3,

exp(1) … results in 2.718281828,

Most of these are similar to abbreviations for functions you’d find in excel or numbers. Spotlight appears to know to ask the calculator app (or a built in library) for the result if it fits a certain format. Taking an exponent in Leopard was pow(10,2) but in Snow Leopard a simpler form is 10^2. Haven’t found the right format for taking the modulus (remainder after division) of two numbers or easily converting between two bases (eg. hex and decimal). Definitely handy for a quick result if your desk calculator isn’t out at the ready.

]]>