Skip to content

Commit

Permalink
Merge pull request JuliaLang#15474 from mronian/add-test
Browse files Browse the repository at this point in the history
Adds test for widemul, div, rem in int.jl
  • Loading branch information
tkelman committed Mar 13, 2016
2 parents 2ebf93f + b3cd8cd commit 264f856
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/int.jl
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ end
@test widemul(false, 3) == 0
@test widemul(3, true) == widemul(true, 3) == 3

let i=Int64(2)^63-1, k=widemul(i,i)
@test widemul(i,i)==85070591730234615847396907784232501249
j=div(k,2)
@test div(k,j)==2
j=div(k,5)
@test rem(k,j)==4
end

# issue #3596
@test Int128(1)<<0 == 1
@test repr(Int128(1)<<1) == "2"

0 comments on commit 264f856

Please sign in to comment.