Skip to content

Commit

Permalink
Merge pull request #17952 from JuliaLang/jb/ndigitstest
Browse files Browse the repository at this point in the history
fix BigInt `ndigits` test
  • Loading branch information
JeffBezanson authored Aug 11, 2016
2 parents eb515f3 + dd09d19 commit 6154db2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/bigint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,11 @@ ndigits_mismatch(n) = ndigits(n) != ndigits(BigInt(n))
ndigits(rand(big(-999:999)), rand(63:typemax(Int)))
ndigits(rand(big(-999:999)), big(2)^rand(2:999))

@test_throws DomainError ndigits(rand(big(-999:999)), rand(typemin(Int):1))
for i in big([-20:-1;1:20])
for b in -10:1
@test_throws DomainError ndigits(i, b)
end
end

# conversion from float
@test BigInt(2.0) == BigInt(2.0f0) == BigInt(big(2.0)) == 2
Expand Down

0 comments on commit 6154db2

Please sign in to comment.