Zoom Shell supports math functions. In the most simple form, you can type an equation in the command line:
2 + 2 (press return)
The answer will appear in the output window and will also get pasted in the command line, so that you can continue with the next calculation.
If the command line does not begin with a number or appear to be an equation, you can direct Zoom Shell to evaluate a command line:
? cos(1)
let sin(3.14)
The following functions are available:
abs -- the absolute value atn -- the arctangent bin -- binomial cos -- cosine exp -- "e" raised to value fac -- factorial fix -- the integer portion of a number ("fix" gives a greater value for negative numbers than "int" does) fuv -- future value based on the rate, number of payments, payment per period, present value int -- the integer portion of a number log -- the log of a number per -- number of periods of an investment based on rate, payment, present value (principal), future value poi -- poisson pmt -- payment based on rate, number of payments, present value (principal), future value prv -- present value based on rate, number of payment periods, payment each period, future value sgn -- the sign of a number (-1 for negative; 1 for positive numbers) sqr -- the square root of a number sin -- the sine of a number tan -- the tangent of a number
In scripts, you can use mathematical expressions in a couple of places. One is the evaluate function, that is used when assigning a value to a variable:
four=evaluate(2+2)
NumLines=evaluate(89-72)
Math is also used in the test expression:
test 4+12 .eq 8+8
Please browse and run the files "variable_fun.zsh" and "function_fun.zsh" in the samples directory to see a few examples of mathematical expressions.