]> www.ginac.de Git - ginac.git/blob - check/factor_univariate_bug.cpp
log_eval: don't apply the log(x^p) -> p*log(x) rule.
[ginac.git] / check / factor_univariate_bug.cpp
1 /**
2  * @file factor_upoly_q_bug.cpp Check for a bug in factor_univariate().
3  *
4  * factor_univariate() didn't check if the argument is an integer polynomial,
5  * the result was a segfault.
6  */
7 #include "ginac.h"
8 #include <iostream>
9 using namespace GiNaC;
10 using namespace std;
11
12 int main(int argc, char** argv)
13 {
14         cout << "checking if factor() handles rational polynomials. ";
15         parser p;
16         ex e = p("174247781*x^2-1989199947807987/200000000000000*x");
17         ex ef = factor(e);
18         ex diff = (e - ef).expand();
19         cout << "yes" << endl;
20         return 0;
21 }