updated: help
git-svn-id: svn://ttmath.org/publicrep/ttcalc/trunk@118 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -16,19 +16,24 @@
|
||||
<h1>User defined variables and functions</h1>
|
||||
|
||||
<p>
|
||||
You are allowed to define your own variables and functions. As a name of a variable or a function
|
||||
can be a name consists of letters, digits or an underline character but the first character must be a letter.
|
||||
You are allowed to define your own variables and functions. As a name of a variable or function
|
||||
can be a name consists of letters, digits or an underline character (only the first character must be a letter).
|
||||
From version 0.8.3 names are case-sensitive that means 'name' is not the same as 'NaMe'. For example these
|
||||
are correct names: a, b, c3, MyName, etc. During defining variables and functions you can call another
|
||||
variables and functions but you cannot call a variable or a function twice. Recurrence calling are not allowed.
|
||||
are correct names: a, b, c3, MyName. During defining variables and functions you can call another
|
||||
variables and functions.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Functions can get maximum 9 parameters. You have to specify how many parameters your function takes and
|
||||
you can refer to them by using the variable 'x' with a number from 1 to 9 ('x' without a number means 'x1').
|
||||
For example you can define a function 'xy' as 'x1*x2' (of course without apostrophes), set the 'parameters' on 2
|
||||
and then put into the edit box an expression 'xy(10;20)', the result will be 200. Note that we use a semicolon
|
||||
to separate arguments in a function.
|
||||
For example you can define a function 'xy' as 'x1*x2' (of course without apostrophes), set the 'parameters' to '2'
|
||||
and then put into the edit box expression 'xy(10;20)', the result will be '200'. Note that we use a semicolon
|
||||
to separate arguments in the function.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
More complex example: myfunction(x) which returns sin(x) when the x is negative, 0 when the x is 0, and cos(x) when the x is greater than 0: <br>
|
||||
myfunction(x)='if(x==0; 0; if(x<0; sin(x); cos(x)))'
|
||||
</p>
|
||||
|
||||
</body>
|
||||
|
Reference in New Issue
Block a user