l = length M
If M is a graded module over a singly graded polynomial ring or a quotient of a polynomial ring over a field k then length is the same as the degree.
If M is over a local ring then length is computed by summing the output of the Hilbert-Samuel function until it vanishes. Note that in this case the LocalRings package must be loaded first.
In the local case, the input is assumed to have finite length.
The source of this document is in Macaulay2Doc/functions/degree-doc.m2:174:0.