Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix BigInt ndigits test #17952

Merged
merged 1 commit into from
Aug 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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