November 12th, 2012, 08:21 PM
Figuring out if polynomial has negative degree?
How would I go about printing out "Degree is below 0" of a polynomial, such as x^-2 + x + 1 or x^2 + x^-1 + 1?
I've tried something like: x^n = x^-2, if n<0: print 'Degree is below 0'.
Any other ideas?
November 12th, 2012, 08:34 PM
I believe I have figured out how to do it, though now my question is, how would I access each term of the polynomial?
November 12th, 2012, 08:45 PM
Solved! Just used .denominator
November 12th, 2012, 08:48 PM
FYI, the degree of a polynomial is always a nonnegative integer, the only exception being the zero polynomial, whose degree is considered infinite.