From 1c02b57476b90cf9c17d327a0585f3c9e3bebd66 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Fri, 7 Dec 2018 10:43:41 +0100 Subject: [PATCH] Fix(Core): degree method of MOpolynomial --- mapytex/calculus/core/MO/polynomial.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mapytex/calculus/core/MO/polynomial.py b/mapytex/calculus/core/MO/polynomial.py index 74508d0..2b8b245 100644 --- a/mapytex/calculus/core/MO/polynomial.py +++ b/mapytex/calculus/core/MO/polynomial.py @@ -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 + + >>> p = MOpolynomial('x', {0: 1, 3: 4}) + >>> p.degree + + + """ + return max(self._coefs.keys()) @property def coefficients(self):