suivant: Functions and expressions with
monter: Operators or infixed functions
précédent: Xcas operators
Table des matières
Index
Define an operator: user_operator
user_operator takes as argument :
- a string : the name of the operator,
- a function of two variables with values in or in
true, false,
- an option Binary for the definition or Delete to annulate
this definition.
user_operator returns 1 if the definition is done and else returns 0.
Example 1
Let R be defined on by
x R y = x*y + x + y.
To define the law R, input :
user_operator("R",(x,y)->x*y+x+y,Binary)
Output :
1
Input :
5 R 7
Do not forget to put spaces around R.
Output :
47
Example 2
Let S by defined on by :
for x and y integers,
x S y < = > x and y are not coprime.
To define the law S, input :
user_operator("S",(x,y)->(gcd(x,y))!=1,Binary)
Output :
1
Input :
5 S 7
Do not forget to put spaces around S.
Output :
0
Input :
8 S 12
Do not forget to put spaces around S.
Output :
1
suivant: Functions and expressions with
monter: Operators or infixed functions
précédent: Xcas operators
Table des matières
Index
giac documentation written by Renée De Graeve and Bernard Parisse