symbol that controls the numeric precision of calculations with inexact numbers.
Assigning an integer value to digits will change the precision to the given
number of decimal places.
+.SS WILDCARDS
+The has(), match() and subs() functions accept wildcards as placeholders for
+expressions. These have the syntax
+.RS
+.BI $ number
+.RE
+for example $0, $1 etc.
.SS LAST PRINTED EXPRESSIONS
ginsh provides the three special symbols
.RS
.BI charpoly( matrix ", " symbol )
\- characteristic polynomial of a matrix
.br
-.BI coeff( expression ", " symbol ", " number )
-\- extracts coefficient of symbol^number from a polynomial
+.BI coeff( expression ", " object ", " number )
+\- extracts coefficient of object^number from a polynomial
+.br
+.BI collect( expression ", " object-or-list )
+\- collects coefficients of like powers (result in recursive form)
.br
-.BI collect( expression ", " symbol )
-\- collects coefficients of like powers
+.BI collect_distributed( expression ", " list )
+\- collects coefficients of like powers (result in distributed form)
.br
.BI content( expression ", " symbol )
\- content part of a polynomial
.br
-.BI degree( expression ", " symbol )
+.BI degree( expression ", " object )
\- degree of a polynomial
.br
.BI denom( expression )
\- greatest common divisor
.br
.BI has( expression ", " expression )
-\- returns "1" if the first expression contains the second as a subexpression, "0" otherwise
+\- returns "1" if the first expression contains the second (which may contain wildcards) as a subexpression, "0" otherwise
.br
.BI inverse( matrix )
\- inverse of a matrix
.BI lcm( expression ", " expression )
\- least common multiple
.br
-.BI lcoeff( expression ", " symbol )
+.BI lcoeff( expression ", " object )
\- leading coefficient of a polynomial
.br
-.BI ldegree( expression ", " symbol )
+.BI ldegree( expression ", " object )
\- low degree of a polynomial
.br
.BI lsolve( equation-list ", " symbol-list )
\- solve system of linear equations
.br
+.BI match( expression ", " pattern )
+\- check whether expression matches a pattern; returns a list of wildcard substitutions or "FAIL" if there is no match
+.br
.BI nops( expression )
\- number of operands in expression
.br
.BI numer( expression )
\- numerator of a rational function
.br
+.BI numer_denom( expression )
+\- numerator and denumerator of a rational function as a list
+.br
.BI op( expression ", " number )
\- extract operand from expression
.br
.BI subs( expression ", " relation-or-list )
.br
.BI subs( expression ", " look-for-list ", " replace-by-list )
-\- substitute subexpressions
+\- substitute subexpressions (you may use wildcards)
.br
-.BI tcoeff( expression ", " symbol )
+.BI tcoeff( expression ", " object )
\- trailing coefficient of a polynomial
.br
.BI time( expression )
.SH EXAMPLES
.nf
> a = x^2\-x\-2;
-\-x+x^2\-2
+\-2\-x+x^2
> b = (x+1)^2;
(x+1)^2
> s = a/b;
-(x+1)^(\-2)*(\-x+x^2\-2)
+(x+1)^(\-2)*(\-2\-x+x^2)
> diff(s, x);
(2*x\-1)*(x+1)^(\-2)\-2*(x+1)^(\-3)*(\-x+x^2\-2)
> normal(s);
x
> s;
(x+1)^(\-2)*(\-x+x^2\-2)
+> series(sin(x),x==0,6);
+1*x+(\-1/6)*x^3+1/120*x^5+Order(x^6)
> lsolve([3*x+5*y == 7], [x, y]);
[x==\-5/3*y+7/3,y==y]
> lsolve([3*x+5*y == 7, \-2*x+10*y == \-5], [x, y]);