Closed khaledkee closed 8 years ago
If the second polynomial had larger degree than the first, dr (Degree of reminder) and dq (degree of quotient) will be negative and will cause OutOfRange exception.
The quotient is obviously null polynomial, I mean 0. The modulus is obviously the first polynomial. So I suppose this would fix the bug:
if(dD > dN) { if(modulus)return N; else return new Complex[1]; }
If the second polynomial had larger degree than the first, dr (Degree of reminder) and dq (degree of quotient) will be negative and will cause OutOfRange exception.