Fix(Core): degree method of MOpolynomial
This commit is contained in:
@@ -71,7 +71,19 @@ class MOpolynomial(MO):
|
||||
|
||||
@property
|
||||
def degree(self):
|
||||
return self._power
|
||||
"""
|
||||
Maximum degree of its coefficient
|
||||
|
||||
:example:
|
||||
>>> p = MOpolynomial('x', [1, 2, 3])
|
||||
>>> p.degree
|
||||
<MOnumber 2>
|
||||
>>> p = MOpolynomial('x', {0: 1, 3: 4})
|
||||
>>> p.degree
|
||||
<MOnumber 3>
|
||||
|
||||
"""
|
||||
return max(self._coefs.keys())
|
||||
|
||||
@property
|
||||
def coefficients(self):
|
||||
|
Reference in New Issue
Block a user