Skip to content

Commit

Permalink
isprime for various int types
Browse files Browse the repository at this point in the history
(cherry picked from commit b2459a6)
  • Loading branch information
kshyatt authored and tkelman committed Nov 29, 2015
1 parent 80724ac commit cd06a1f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/numbers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2126,6 +2126,11 @@ end
@test !isprime(0xffffffffffffffc7)
@test !isprime(0xffffffffffffffc9)

for T in [Int8,UInt8,Int16,UInt16,Int128,UInt128]
@test isprime(T(2))
@test !isprime(T(4))
end

# issue #5210
@test prod([ k^v for (k,v) in factor(typemax(UInt32)) ]) == typemax(UInt32)
@test prod([ k^v for (k,v) in factor(typemax(Int8)) ]) == typemax(Int8)
Expand Down

0 comments on commit cd06a1f

Please sign in to comment.