Fix(Core): degree method of MOpolynomial

This commit is contained in:
Bertrand Benjamin 2018-12-07 10:43:41 +01:00
parent 5bf23a4793
commit 1c02b57476
1 changed files with 13 additions and 1 deletions

View File

@ -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):