From 79aaa3c5d9a17a9e3bf3ccfafd49ca62cdd87288 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Fri, 7 Dec 2018 10:47:00 +0100 Subject: [PATCH] Feat(core): add power attribut to MOPolynomial --- mapytex/calculus/core/MO/polynomial.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mapytex/calculus/core/MO/polynomial.py b/mapytex/calculus/core/MO/polynomial.py index 2b8b245..cecea32 100644 --- a/mapytex/calculus/core/MO/polynomial.py +++ b/mapytex/calculus/core/MO/polynomial.py @@ -71,8 +71,8 @@ class MOpolynomial(MO): @property def degree(self): - """ - Maximum degree of its coefficient + """ + Maximum degree of its coefficient :example: >>> p = MOpolynomial('x', [1, 2, 3]) @@ -85,6 +85,10 @@ class MOpolynomial(MO): """ return max(self._coefs.keys()) + @property + def power(self): + return self.degree + @property def coefficients(self): return self._coefs