returns the maximal (weighted) degree of
the terms of a polynomial or a vector;
deg(0) is -1.
The optional second argument gives the weight vector,
the default weights of the base ring will be used otherwise.
Example:
ring r=0,(x,y,z),lp;
deg(0);
→ -1
deg(x3+y4+xyz3);
→ 5
ring rr=7,(x,y),wp(2,3);
poly f=x2+y3;
deg(f);
→ 9
ring R=7,(x,y),ws(2,3);
poly f=x2+y3;
deg(f);
→ 9
vector v=[x2,y];
deg(v);
→ 4