up previous next
Len

the length of an object
Syntax

Len(E:OBJECT):INT


Description
This function returns the length of an object, as summarized in the table below:
      ----------------------------------------------
     | type   | length                              |
     -----------------------------------------------|
     | IDEAL  | length of Gens(E)                   |
     | INT    | 1                                   |
     | LIST   | number of items in the list         |
     | MAT    | number of rows of the matrix        |
     | MODULE | length of Gens(E)                   |
     | POLY   | number of monomials                 |
     | RATFUN | if E=F/G, then Len(E)=Len(F)+Len(G) |
     | VECTOR | number of components                |
      ----------------------------------------------
               The operator Len


Example
  Use R ::= QQ[x,y];
  L := ["a",2,3,[4,5]];
  Len(L);
4
-------------------------------
  Len(L[1]);
1
-------------------------------
  Len(L[4]);
2
-------------------------------
   Len(x^2 + xy + y^2 + xy^4);
4
-------------------------------
  Len((x^2+y^2)/(x+y+y^2));
5
-------------------------------
  Len((x+y) - (xy/x));
1
-------------------------------
  Len(Ideal(x,x^2));
2
-------------------------------
The function Size returns the amount of memory used by the object.

See Also