diff --git a/src/polynomial.cpp b/src/polynomial.cpp index e221697..7ad47d1 100644 --- a/src/polynomial.cpp +++ b/src/polynomial.cpp @@ -23,8 +23,8 @@ int polynomial::degree() const { - int r = -1; - for (uint i = 0; i < size(); ++i) if (item (i) ) r = i; + int r; + for (r = ( (int) size() ) - 1; r >= 0; --r) if (item (r) ) break; return r; }