|
4.5.2 intvec expressions
An intvec expression is:
-
a range: int expression
.. int expression
-
a function returning intvec
-
intvec operations with int (
+ , - , * , / , % )
-
intvec operations (
+ , - )
-
intvec operation with intmat (
* )
-
a type cast to intvec
Example:
| intvec v=-1,2;
intvec w=v,v; // concatenation
w;
==> -1,2,-1,2
w = -2..2,v,1;
w;
==> -2,-1,0,1,2,-1,2,1
intmat m[3][2] = 0,1,2,-2,3,1;
m*v;
==> 2,-6,-1
typeof(_);
==> intvec
v = intvec(m);
v;
==> 0,1,2,-2,3,1
ring r;
poly f = x2z + 2xy-z;
f;
==> x2z+2xy-z
v = leadexp(f);
v;
==> 2,0,1
|
|