Bill Allombert on Thu, 16 Dec 1999 21:21:46 +0100 (MET) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: poldegree bug? |
There are two commonly used definition of the degree of a rational fraction R=P/Q The first is deg P-deg Q, the second is max(d°P,d°Q) PARI return the degree as in the first definition. so poldegree(1/x^2)==-2 poldegree(1/(x^2+1))==-2 poldegree(1/x^2+1)==poldegree((x^2+1)/x^2)==0 So the result is correct. Did you eventually mistype the parens ?it happens... But the specifications say that the degree of the zero polynomial is -1, that is strange: poldegree(1/x) -1 poldegree(Pol([])) -1 poldegree(0) Well, I think ~VERYBIGINT would be cleaner for 0 polynomials. In fact this is done to match the behaviour of the library function "degree" which apply only to POL and simply return lgef(P)-3, so degree(Pol([]))=2-3=-1 Beside, there is no polvaluation fonction, but we can use valuation(P,x) instead. Bill.