We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0312f8 commit 462318eCopy full SHA for 462318e
src/flint/types/nmod_poly.pyx
@@ -260,7 +260,10 @@ cdef class nmod_poly(flint_poly):
260
45*x^4 + 23*x^3 + 159*x^2 + 151*x + 110
261
"""
262
if n <= 0:
263
- raise ValueError("n must be positive")
+ raise ValueError(f"{n = } must be positive")
264
+
265
+ if self.is_zero():
266
+ raise ValueError(f"cannot invert the zero element")
267
268
cdef nmod_poly res
269
res = nmod_poly.__new__(nmod_poly)
0 commit comments