next up previous contents index
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 : user_operator returns 1 if the definition is done and else returns 0.

Example 1
Let R be defined on $ \mathbb {R}$ 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 $ \mathbb {N}$ 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


next up previous contents index
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