Artifact e2103923e03616534f21678c2cbf61086e77e68d1aaaa590cecdc765e604c252:
- Executable file
r37/lisp/csl/html/r37_0157.html
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1711) [annotate] [blame] [check-ins using] [more...]
<A NAME=LENGTH> <TITLE>LENGTH</TITLE></A> <b><a href=r37_idx.html>INDEX</a></b><p><p> <B>LENGTH</B> _ _ _ _ _ _ _ _ _ _ _ _ <B>operator</B><P> <P> <P> <P> The <em>length</em> operator returns the number of items in a <A HREF=r37_0053.html>list</A>, the number of terms in an expression, or the dimensions of an array or matrix. <P> <H3> syntax: </H3> <P> <P> <em>length</em>(<expr>) or <em>length</em> <expr> <P> <P> <P> <expr> can be a list structure, an array, a matrix, or a scalar expression . <P> <P> <P> <H3> examples: </H3> <P><PRE><TT> alist := {a,b,{ww,xx,yy,zz}}; ALIST := {A,B,{WW,XX,YY,ZZ}} length alist; 3 length third alist; 4 dlist := {d}; DLIST := {D} length rest dlist; 0 matrix mmm(4,5); length mmm; {4,5} array aaa(5,3,2); length aaa; {6,4,3} eex := (x+3)**2/(x-y); 2 X + 6*X + 9 EEX := ------------ X - Y length eex; 5 </TT></PRE><P>An item in a list that is itself a list only counts as one item. A n error message will be printed if <em>length</em> is called on a matrix which has not had its dimensions set. The <em>length</em> of an array includes the zeroth element of each dimension, showing the full number of elements allocated. (Declaring an array A with n elements allocates A(0),A(1),...,A(n).) The <em>length</em> of an expression is the total number of additive terms appearing in the numerator and denominator of the expression. Note that subtraction of a term is represented internally as addition of a negative term. <P> <P> <P>