Skip to content

Commit ce633dc

Browse files
committed
Add attribute error for base class for complex_roots
1 parent 0a1c264 commit ce633dc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/flint/flint_base/flint_base.pyx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ cdef class flint_poly(flint_elem):
7171
integer root and *m* is the multiplicity of the root.
7272
7373
To compute complex roots of a polynomial, instead use
74-
the `.complex_roots()` method.
74+
the `.complex_roots()` method, which is available on
75+
certain polynomial rings.
7576
7677
>>> from flint import fmpz_poly
7778
>>> fmpz_poly([1, 2]).roots()
@@ -94,6 +95,9 @@ cdef class flint_poly(flint_elem):
9495
v = - fac[0]
9596
roots.append((v, m))
9697
return roots
98+
99+
def complex_roots(self):
100+
raise AttributeError("Complex roots are not supported for this polynomial")
97101

98102

99103
cdef class flint_mpoly(flint_elem):

0 commit comments

Comments
 (0)