Skip to content

Commit

Permalink
fix type-stability for factoring weird Integer types.
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardssmith authored Nov 12, 2023
1 parent e89b703 commit efb632f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Primes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ function iterate(f::FactorIterator{T}, state=(f.n, T(3))) where T
n == 0 && return (T(n), 1), (T(1), p)
end
tz = trailing_zeros(n)
tz>0 && return (T(2), tz), (n >> tz, p)
tz>0 && return (T(2), Int(tz)), (n >> tz, p)
if n <= N_SMALL_FACTORS
p = _min_factor(n)
num_p = 1
Expand Down

0 comments on commit efb632f

Please sign in to comment.