What is a polynomial in x?
Richard B. Kreckel
kreckel at thep.physik.uni-mainz.de
Fri Mar 8 14:40:19 CET 2002
On Thu, 7 Mar 2002, Christian Bauer wrote:
> On Thu, Mar 07, 2002 at 12:58:59PM +0100, Roberto Bagnara wrote:
> > if (is_a_polynomial(e, x)) {
>
> if (e.info(info_flags::polynomial)) {
>
> (there's also info_flags::integer_polynomial and a couple of others; the
> complete list is in the GiNaC tutorial)
[...]
Just one point: The precondition (e.info(info_flags::polynomial)==true)
does not make it safe to call .degree(x) in the sense that the result is
precise -- it might still be an upper limit. The reason is the same as
always considering that even an unexpanded polynomial is a polynomial.
Regards
-richy.
--
Richard B. Kreckel
<Richard.Kreckel at Uni-Mainz.DE>
<http://wwwthep.physik.uni-mainz.de/~kreckel/>
More information about the GiNaC-list
mailing list