Home Online Manual
Top
Back: defined
Forward: degree
FastBack: Functions and system variables
FastForward: Control structures
Up: Functions
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

5.1.19 deg

Syntax:
deg ( poly_expression )
deg ( vector_expression )
deg ( poly_expression , intvec_expression )
deg ( vector_expression , intvec_expression )
Type:
int
Purpose:
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, otherwise weight 1 is used for lex orderings and block ordering, the default weights of the base ring are used for orderings consisting of one block.

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
See jet; ord; poly; vector.