We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d1a8758 commit c42fa0aCopy full SHA for c42fa0a
1 file changed
src/flint/types/fmpz.pyx
@@ -683,6 +683,14 @@ cdef class fmpz(flint_scalar):
683
return fmpz_is_probabprime(self.val)
684
685
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
+ """
694
cdef int k
695
cdef fmpz v = fmpz()
696
k = fmpz_is_perfect_power(v.val, self.val)
0 commit comments