Skip to content

Commit c42fa0a

Browse files
committed
add docstring for is_perfect_power
1 parent d1a8758 commit c42fa0a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/flint/types/fmpz.pyx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,14 @@ cdef class fmpz(flint_scalar):
683683
return fmpz_is_probabprime(self.val)
684684

685685
def is_perfect_power(self):
686+
r"""
687+
Return True if this integer is of the form `r^k`, False otherwise.
688+
689+
>>> fmpz(81).is_perfect_power()
690+
True
691+
>>> fmpz(1234).is_perfect_power()
692+
False
693+
"""
686694
cdef int k
687695
cdef fmpz v = fmpz()
688696
k = fmpz_is_perfect_power(v.val, self.val)

0 commit comments

Comments
 (0)