Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardssmith committed Dec 11, 2024
1 parent ad4c66d commit 00ea174
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Primes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -387,15 +387,15 @@ function iterate(f::FactorIterator{T}, state=(f.n, T(3))) where T
return (n, 1), (T(1), n)
end
# check for n=root^r
r = cld(ndigits(n, base=2), ndigits(Primes.PRIMES[end], base=2))
root = inthroot(n, r)
r = cld(ndigits(n, base=2), ndigits(N_SMALL_FACTORS, base=2))
root = iroot(n, r)
while r >= 2
if root^r == n
isprime(root) && return (root, r), (n, root+2)

end
r -= 1
root = inthroot(n, r)
root = iroot(n, r)
end

should_widen = T <: BigInt || widemul(n - 1, n - 1) typemax(n)
Expand Down

0 comments on commit 00ea174

Please sign in to comment.