[GiNaC-devel] help

Qin An qin.an at 163.com
Tue Dec 21 11:21:04 CET 2004


some standard functions do not run smothfully everytime


the function -- expand:
when I used it as follow:
#include <iostream>
#include <ginac/ginac.h>
using namespace std;
using namespace GiNaC;
   
main()
{
  ex e = expand(power(x+1,2));
  cout << e << endl;
}
the result given by ginac is: (x+1)^2
but when I give him the parameters as follows:
main()
{
  ex e = expand((x+1)*(x+1));
  cout << e << endl;
}     
the result is right: 1.0 + x^2.0 + 2.0*x

the difference above is conspicuous, when the above function  has been used in other C++ class files that have not the main function.

could anyone give some advice?  thanks!

by the way, my computer is PIII 550, REDHAT Linux 9,gcc is 3.0, and the developing tool is kdevelop.
thank you


- Qin An





More information about the GiNaC-devel mailing list