> I ended up writing my own polynomial test using rat which came to about
> 3 lines. It's considerably simpler than those from RJF because the only
> question is "Can this expression be written in powers of <var>" and (I
> think) you can check this by just calling rat() on the expression with
> var as the variable and then checking the resulting header.
Your code is indeed considerably simpler, but incorrect in many simple
cases. All the following are polynomials in x but your code reports
that they are not:
%pi
a
x+a
a*x
rat(x,q)
Barton Willis's code is correct, I believe.
-s