polynomial: degree computation dumbness reduced
This commit is contained in:
parent
be13fe8dca
commit
79b17b8724
|
@ -23,8 +23,8 @@
|
||||||
|
|
||||||
int polynomial::degree() const
|
int polynomial::degree() const
|
||||||
{
|
{
|
||||||
int r = -1;
|
int r;
|
||||||
for (uint i = 0; i < size(); ++i) if (item (i) ) r = i;
|
for (r = ( (int) size() ) - 1; r >= 0; --r) if (item (r) ) break;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue