Skip to content

Commit 4c40652

Browse files
committed
4 isn't prime
1 parent aea3ccb commit 4c40652

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Primes.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ end
179179
# http://ntheory.org/pseudoprimes.html
180180
# http://ntheory.org/pseudoprimes.html
181181
function isprime(n::Int64)
182+
iseven(n) && return n == 2
182183
if n < N_SMALL_FACTORS
183184
n < 2 && return false
184185
return _min_factor(n) == n
185186
end
186-
iseven(n) && return n == 2
187187
for m in (3, 5, 7, 11, 13, 17, 19, 23)
188188
n % m == 0 && return false
189189
end

0 commit comments

Comments
 (0)