6.14.1 Xcas operators: $ %
-
$ is the infixed version of seq (see
Section 6.39.2).
Example.
Input:
(2^k)$(k=0..3)
(do not forget to put parenthesis around the arguments)
or:
seq(2^k,k=0..3)
Output:
- mod or % defines a modular number; a mod n is
the equivalence class of a in ℤ/nℤ.
Example.
Input:
5 % 7
or:
5 mod 7
Output:
- @ is used to compose functions; (f@g)(x)=f(g(x)).
Example.
Input:
(sin@exp)(x)
Output:
- @@ is used to compose a function with itself many times (like
a power, replacing multiplication by composition); for example,
(f@@3)(x)=f(f(f(x))).
Example.
Input:
(sin@@4)(x)
Output:
sin | ⎛
⎝ | sin | ⎛
⎝ | sin | ⎛
⎝ | sinx | ⎞
⎠ | ⎞
⎠ | ⎞
⎠ |
- minus, union and intersect return the difference, the union and the
intersection of two sets, respectively. (See Section 5.3.2).
Example.
Input:
A := set[1,2,3,4]; |
B := set[3,4,5,6];
|
then:
A minus B
Output:
Input:
A union B
Output:
then:
A intersect B
Output:
- -> is used to define a function, which can be assigned a name.
Example.
Input:
(x->x^2)(3)
Output:
Input:
f := x -> x^2
then:
f(3)
Output:
- => is the infixed version of sto (see
Section 5.4.2) and so is used to store an expression in a
variable.
Example.
Input:
2 => a
then:
a
Output:
- := is used to store an expression in a variable, but the
variable comes first (the argument order is switched from =>).
Example.
Input:
a := 2
then:
a
Output:
- =< to store an expression in a variable, but the storage is
done by reference if the target is a matrix element or a list element.
This is faster if you modify objects inside an existing list or matrix
of large size, because no copy is made, the change is done in place.
Use with care, all objects pointing to this matrix or list will
be modified.
Example.
Input:
then:
L[0] =< 5
and:
L
Output:
Input:
L2
Output: