8.1.1 Special Xcas operators
Sequences.
$ is the infixed
version of seq (see Section 6.1.2).
For example (do not forget to put parenthesis around the arguments):
or:
Modular numbers.
mod or
%
defines a modular number; a mod n is
the equivalence class of a in ℤ/nℤ.
For example:
or:
Function composition.
@
is used to compose functions; (f@g)(x)=f(g(x)).
For example:
@@ is used to compose a function
with itself several times (like a power, replacing multiplication by
composition), e.g. (f@@3)(x)=f(f(f(x))).
For example:
|
sin | ⎛
⎝ | sin | ⎛
⎝ | sin | ⎛
⎝ | sinx | ⎞
⎠ | ⎞
⎠ | ⎞
⎠ |
| | | | | | | | | | |
|
Set operations.
minus, union and intersect return the difference, the union and the
intersection of two sets, respectively. (See Section 3.2.2).
For example:
A:=set[1,2,3,4]:; B:=set[3,4,5,6]:; |
Defining functions.
-> is used to define a function, which can be assigned a name.
For example:
Assignment.
=> is the infixed version of sto (see
Section 3.3.2) and so is used to store an expression in a
variable.
For example:
:= is used to store an expression in a variable, but the
variable comes first (the argument order is switched from =>).
For example:
=< 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.
For example:
then: