Skip to content

Commit

Permalink
fixes sympy#24394
Browse files Browse the repository at this point in the history
  • Loading branch information
1e9abhi1e10 committed Dec 16, 2022
1 parent e4c27fa commit 1cc99a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sympy/polys/polytools.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
PolificationFailed,
ComputationFailed,
GeneratorsError,
NotInvertible,
)
from sympy.polys.polyutils import (
basic_from_dict,
Expand Down Expand Up @@ -2589,7 +2590,8 @@ def invert(f, g, auto=True):
"""
dom, per, F, G = f._unify(g)

if G.degree() < 1:
raise NotInvertible('constant modulus in polynomial ring')
if auto and dom.is_Ring:
F, G = F.to_field(), G.to_field()

Expand Down

0 comments on commit 1cc99a1

Please sign in to comment.