]> www.ginac.de Git - ginac.git/commitdiff
* Check polynomialism of resultant() args.
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Sat, 10 Jul 2004 00:06:29 +0000 (00:06 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Sat, 10 Jul 2004 00:06:29 +0000 (00:06 +0000)
ginac/normal.cpp

index 8ba5df0de4810f14485e588b306945381f2647cd..1e7ed3a290af6aa0395995527658f2096fe1439d 100644 (file)
@@ -2381,6 +2381,10 @@ ex resultant(const ex & e1, const ex & e2, const ex & s)
 {
        const ex ee1 = e1.expand();
        const ex ee2 = e2.expand();
 {
        const ex ee1 = e1.expand();
        const ex ee2 = e2.expand();
+       if (!ee1.info(info_flags::polynomial) ||
+           !ee2.info(info_flags::polynomial))
+               throw(std::runtime_error("resultant(): arguments must be polynomials"));
+
        const int h1 = ee1.degree(s);
        const int l1 = ee1.ldegree(s);
        const int h2 = ee2.degree(s);
        const int h1 = ee1.degree(s);
        const int l1 = ee1.ldegree(s);
        const int h2 = ee2.degree(s);