Skip to content

Commit fef5fcd

Browse files
authored
fix type-stability for factoring weird Integer types. (#146)
* fix type-stability for factoring weird Integer types. * Update Project.toml
1 parent e89b703 commit fef5fcd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Primes"
22
uuid = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae"
3-
version = "0.5.4"
3+
version = "0.5.5"
44

55
[deps]
66
IntegerMathUtils = "18e54dd8-cb9d-406c-a71d-865a43cbb235"

src/Primes.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ function iterate(f::FactorIterator{T}, state=(f.n, T(3))) where T
346346
n == 0 && return (T(n), 1), (T(1), p)
347347
end
348348
tz = trailing_zeros(n)
349-
tz>0 && return (T(2), tz), (n >> tz, p)
349+
tz>0 && return (T(2), Int(tz)), (n >> tz, p)
350350
if n <= N_SMALL_FACTORS
351351
p = _min_factor(n)
352352
num_p = 1

0 commit comments

Comments
 (0)