Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/flint/types/fmpz_mod_poly.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1903,8 +1903,8 @@ cdef class fmpz_mod_poly(flint_poly):

def roots(self, multiplicities=True):
r"""
Return the roots of the polynomial in :math:`(\mathbb{Z}/N\mathbb{Z})^*`
Requires that the modulus `N` is prime.
Return the roots of a nonzero polynomial in the finite field
:math:`\mathbb{Z}/N\mathbb{Z}`, where the modulus `N` must be prime.

>>> R = fmpz_mod_poly_ctx(163)
>>> x = R.gen()
Expand All @@ -1913,6 +1913,8 @@ cdef class fmpz_mod_poly(flint_poly):
[(fmpz_mod(1, 163), 1), (fmpz_mod(2, 163), 3), (fmpz_mod(3, 163), 5)]
>>> f.roots(multiplicities=False)
[fmpz_mod(1, 163), fmpz_mod(2, 163), fmpz_mod(3, 163)]
>>> (x**2).roots()
[(fmpz_mod(0, 163), 2)]
"""
cdef fmpz_mod_poly_factor_t fac
cdef int i, with_multiplicity
Expand Down
Loading