Here's an easy script for calculating. It includes every function (add, subtract, multiply, divide, exponents, and probably more)
on *:TEXT:.calc *:#: msg $chan $nick $+ : $calc($2-)
Example: .calc (3.14159 * (2 ^ %x % 3) - ($ticks / (10000 + 1)))
Edit: This is in response to crazyhand