Skip to content

Commit

Permalink
Allow negative integers to is_prime_power()
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed Feb 8, 2022
1 parent 60bb49a commit 31a9e2a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions galois/_factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ def is_prime_power(n: int) -> bool:
Parameters
----------
n : int
A positive integer.
An integer.
Returns
-------
Expand All @@ -734,10 +734,8 @@ def is_prime_power(n: int) -> bool:
"""
if not isinstance(n, (int, np.integer)):
raise TypeError(f"Argument `n` must be an integer, not {type(n)}.")
if not n > 0:
raise ValueError(f"Argument `n` must be a positive integer, not {n}.")

if n == 1:
if n < 2:
return False

if is_prime(n):
Expand Down

0 comments on commit 31a9e2a

Please sign in to comment.