Hello, I thought this was missing from the documentation: --- ginac.texi.orig Mon Mar 15 18:47:17 2004 +++ ginac.texi Thu Jun 10 09:41:09 2004 @@ -4905,6 +4905,12 @@ @item @code{binomial(n, m)} @tab binomial coefficients @cindex @code{binomial()} +@item @code{bernoulli(n)} +@tab Bernoulli numbers +@cindex @code{bernoulli()} +@item @code{fibonacci(n)} +@tab Fibonacci numbers +@cindex @code{fibonacci()} @item @code{Order(x)} @tab order term function in truncated power series @cindex @code{Order()}
--- ginac.texi.orig Mon Mar 15 18:47:17 2004 +++ ginac.texi Thu Jun 10 16:52:53 2004 @@ -3078,7 +3078,7 @@ @multitable @columnfractions .30 .70 @item @strong{Flag} @tab @strong{Returns true if the object is@dots{}} @item @code{numeric} -@tab @dots{}a number (same as @code{is_<numeric>(...)}) +@tab @dots{}a number (same as @code{is_a<numeric>(...)}) @item @code{real} @tab @dots{}a real integer, rational or float (i.e. is not complex) @item @code{rational}
Should I subscribe to the dev-list? Here is a correction and a suggestion in the patch, the latter just a hint what errors are being made by newbies. If you don't like it, reformulate. ralf --- ginac.texi.orig Mon Mar 15 18:47:17 2004 +++ ginac.texi Thu Jun 10 19:21:26 2004 @@ -4293,7 +4293,7 @@ @example @{ - symbol a("a"), b("b"), c("c"); + symbol a("a"), b("b"), c("c"), x("x"); idx i(symbol("i"), 3); ex e = pow(sin(x) - cos(x), 4); @@ -4309,6 +4309,34 @@ @} @end example +This is a good place to remind you that symbols are not uniquely identified +by their string representation but by the C++ variable they were assigned to. +This means that the first of the following two examples will not output 6 +but 0: + +@example +@{ + ex f(int n) @{ symbol x("x"); return pow(x+1,n); @} + ... + symbol x("x"); + ... + cout << f(6).degree(x) << endl; // WRONG +@} +@end example + +For clarity, efficiency, and modularity, it should have been coded: + +@example +@{ + ex f(int n, symbol& x) @{ return pow(x+1,n); @} + ... + symbol x("x"); + ... + cout << f(6,x).degree(x) << endl; // RIGHT +@} +@end example + + @subsection Polynomial division @cindex polynomial division
Hi! On Thu, Jun 10, 2004 at 07:28:53PM +0200, Ralf Stephan wrote:
Here is a correction and a suggestion in the patch
Thanks for your input! I have expanded the tutorial somewhat. Bye, Christian -- / Physics is an algorithm \/ http://www.uni-mainz.de/~bauec002/
participants (2)
-
Christian Bauer
-
Ralf Stephan