You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUG: polydiv returns an infinite quotient for a divisor with a leading zero #33422
At what value of the leading coefficient? In numerical work, the degree of a polynomial is not a well defined concept, that is why it is left to the user.
Activity
charris commentedon Nov 22, 2026
Yes, it will. Don't do that, trim the zero. There is a trim method for Polynomials.
lesshaste commentedon Nov 22, 2026
@charris I feel numpy should at least output a warning.
charris commentedon Nov 22, 2026
At what value of the leading coefficient? In numerical work, the degree of a polynomial is not a well defined concept, that is why it is left to the user.
lesshaste commentedon Nov 22, 2026
@charris I would adopt an exact zero rule for automated trimming. Small nonzero terms are more difficult and probably just need a note in the docs
charris commentedon Nov 22, 2026
It substitutes one error with another. Improving the documentation is an option, perhaps with an example.
charris commentedon Nov 22, 2026
Note that
numpy.polynomial.polynomial.polydivdoes not have this problem.