Go to the first, previous, next, last section, table of contents.


user-defined

New user-defined variables and functions of one through five variables may be declared and used anywhere.

User-defined function syntax:

       <function-name> ( <dummy1> {,<dummy2> {, ...} } ) = <expression>

where <expression> is defined in terms of <dummy1> through <dummy5>.

User-defined variable syntax:

       <variable-name> = <constant-expression>

Examples:

       w = 2
       q = floor(tan(pi/2 - 0.1))
       f(x) = sin(w*x)
       sinc(x) = sin(pi*x)/(pi*x)
       delta(t) = (t == 0)
       ramp(t) = (t > 0) ? t : 0
       min(a,b) = (a < b) ? a : b
       comb(n,k) = n!/(k!*(n-k)!)
       len3d(x,y,z) = sqrt(x*x+y*y+z*z)

Note that the variable pi is already defined.

See show functions and show variables.


Go to the first, previous, next, last section, table of contents.