FUNCDEF: Difference between revisions

From iMath
Jump to navigation Jump to search
(Created page with "{{Keyword | 1= <code>@label@ { options } FUNCDEF * funcname(symbol|exlist) = expression</code> | 2= Define an equation that can be used to find the value...")
 
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
|
|
1=
1=
<code>@label@ { [[options]] } FUNCDEF * funcname([[symbol]]&#124;[[exlist]]) = [[expression]]</code>
<code>@label@ { [[options]] } FUNCDEF * funcname([[symbol]]&#124;[[symbol list]]) = [[expression]]</code>
|
|
2=
2=
Line 11: Line 11:
3=
3=
<code>@f@ FUNCDEF f(x) = 3 x^2 + 2 x + 1</code> tells iMath how to find the value of <code>f</code> for a given value of <code>x</code>.
<code>@f@ FUNCDEF f(x) = 3 x^2 + 2 x + 1</code> tells iMath how to find the value of <code>f</code> for a given value of <code>x</code>.
|4=
[[FUNCTION]]
}}
}}
== Special notes ==
When you use [[SIMPLIFY|simplification type]] <code>expand</code> on a function, it will be replaced by the definition given with <code>FUNCDEF</code>. If you do not want this, simply define the value of your function in a normal equation with [[EQDEF]]. Then you can replace your function with its definition by [[SUBST|substitution]].


[[Category:Definition]]
[[Category:Definition]]

Latest revision as of 15:33, 2 July 2017

Syntax

@label@ { options } FUNCDEF * funcname(symbol|symbol list) = expression

Implemented in iMath since version 2.2.0 or earlier.

Explanation

Define an equation that can be used to find the value of a user-defined function. The function must first have been declared with FUNCTION.

The starred form will suppress printing of the result.

Example

@f@ FUNCDEF f(x) = 3 x^2 + 2 x + 1 tells iMath how to find the value of f for a given value of x.

See also

FUNCTION

Special notes

When you use simplification type expand on a function, it will be replaced by the definition given with FUNCDEF. If you do not want this, simply define the value of your function in a normal equation with EQDEF. Then you can replace your function with its definition by substitution.