If you noticed in response of the square root, there are special funcitons for doing advanced math in JavaScript and FormCalc. The JavaScirpt's advance funcitons are described in the Mozilla JavaScript documentaion and FormCalc's is partially done in the included scriptig references.
JavaScript:
Math.pow(fBaseNumber, fExponent)
FormCalc:
Pow(fBaseNumber, fExponent)
The exponent function and square root are both undocumented functions in FormCalc. The FormCalc funciton for the square root is "Sqrt(fValue)".
There is also an average function for both JavaScript and FormCalc.