Fix(Core): degree method of MOpolynomial
This commit is contained in:
parent
5bf23a4793
commit
1c02b57476
@ -71,7 +71,19 @@ class MOpolynomial(MO):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def degree(self):
|
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
|
@property
|
||||||
def coefficients(self):
|
def coefficients(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user