Operators:
+ - * / and parentheses
Constants:
pi
(=3.14...), e (=2.718...), deg(=180/pi = 57.2...)
Built-in Functions...
[Unless otherwise indicated, all functions take a single
numeric argument, enclosed in parentheses after the name of the function.]
Algebraic:
abs, sqrt, power(x,y) [= x raised to power of y)], fact [factorial] , gamma
[gamma(n)=fact(n-1)]
Transcendental:
exp, ln [natural], log10, log2
Trigonometric:
sin, cos, tan, cot, sec, csc
Inverse Trig:
asin, acos, atan, acot, asec, acsc
Hyperbolic:
sinh, cosh, tanh, coth, sech, csch
Inverse Hyp:
asinh, acosh, atanh, acoth, asech, acsch
Statistical:
norm, gauss, erf, chisq(x,df), studt(t,df), fishf(F,df1,df2)
Inverse Stat:
anorm, agauss, aerf, achisq(p,df), astudt(p,df),
afishf(p,df1,df2)
Note: JavaScript
cannot recognize the ^ operator commonly used to indicate "raising to a power".
Instead, you must use the Power function to do this. So,
instead of a^b, you must use power(a,b).
For example, if you want the square of five, do not use 5^2;
use power(5,2), which returns 25.
Note: The trig
functions work in radians. For degrees, multiply or divide by the deg variable. For example:
sin(30/deg) will return 0.5, and atan(1)*deg will return 45.
Note: The
factorial and Gamma functions are implemented for all real numbers. For non-integers its accuracy
is about 6 significant figures. For negative integers it returns either a very large number or a
division-by-zero error. See the Handbook of Mathematical Functions for a description of the very
unusual behavior of the factorials of negative numbers.
Note: The
statistical functions norm and studt return 2-tail p-values (e.g.: norm(1.96) returns 0.05), while
chisq and fishf return 1-tail values. This is consistent with the way these functions are most
frequently used in statistical testing. Mathematical purists would probably prefer a "left
integral" (representing the area under the curve between minus infinity and z). If you want the
left integral of the normal (Gaussian) probability function, use gauss(z) (e.g.: gauss(1.96)
returns 0.975). I've also provided erf (the classic "error function"; if you don't know what erf
is, then you don't need it). I've also provided the inverses: agauss and aerf.
Disclaimer: I make no guarantees and assume no
responsibility for any computational inaccuracies or their consequences.