]> www.ginac.de Git - ginac.git/blobdiff - doc/tutorial/ginac.texi
- fixed typos
[ginac.git] / doc / tutorial / ginac.texi
index 06e4a8ca9983817d0d3625ec34e2fb1ada7a0aee..346a2955def07a4dbcd65a2083dfbb97699a8627 100644 (file)
@@ -684,8 +684,8 @@ ex MyEx4 = sin(x + 2*y) + 3*z + 41; // containing a function
 ex MyEx5 = MyEx4 + 1;               // similar to above
 @end example
 
-Expressions are handles to other more fundamental objects, that many
-times contain other expressions thus creating a tree of expressions
+Expressions are handles to other more fundamental objects, that often
+contain other expressions thus creating a tree of expressions
 (@xref{Internal Structures}, for particular examples).  Most methods on
 @code{ex} therefore run top-down through such an expression tree.  For
 example, the method @code{has()} scans recursively for occurrences of
@@ -1232,13 +1232,19 @@ a relation between them that signals equality, inequality and so on.
 They are created by simply using the C++ operators @code{==}, @code{!=},
 @code{<}, @code{<=}, @code{>} and @code{>=} between two expressions.
 
-@xref{Mathematical functions}, for examples where various applications of
-the @code{.subs()} method show how objects of class relational are used
-as arguments.  There they provide an intuitive syntax for substitutions.
-They can also used for creating systems of equations that are to be
-solved for unknown variables.  More applications of this class will
-appear throughout the next chapters.
-
+@xref{Mathematical functions}, for examples where various applications
+of the @code{.subs()} method show how objects of class relational are
+used as arguments.  There they provide an intuitive syntax for
+substitutions.  They are also used as arguments to the @code{ex::series}
+method, where the left hand side of the relation specifies the variable
+to expand in and the right hand side the expansion point.  They can also
+be used for creating systems of equations that are to be solved for
+unknown variables.  But the most common usage of objects of this class
+is rather inconspicuous in statements of the form @code{if
+(expand(pow(a+b,2))==a*a+2*a*b+b*b) @{...@}}.  Here, an implicit
+conversion from @code{relational} to @code{bool} takes place.  Note,
+however, that @code{==} here does not perform any simplifications, hence
+@code{expand()} must be called explicitly.
 
 
 @node Methods and Functions, Information About Expressions, Relations, Top
@@ -1474,7 +1480,7 @@ bool ex::is_zero();
 for checking whether one expression is equal to another, or equal to zero,
 respectively.
 
-@strong{Warning:} You will also find a @code{ex::compare()} method in the
+@strong{Warning:} You will also find an @code{ex::compare()} method in the
 GiNaC header files. This method is however only to be used internally by
 GiNaC to establish a canonical sort order for terms, and using it to compare
 expressions will give very surprising results.