Skip to content

Commit

Permalink
fix infinite loop in rand(::Range(BigInt))
Browse files Browse the repository at this point in the history
  • Loading branch information
rfourquet committed Sep 6, 2014
1 parent c786d72 commit bbfd711
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/random.jl
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function rand{T<:Integer, U<:Unsigned}(g::RandIntGen{T,U})
end

rand{T<:Union(Signed,Unsigned,Bool,Char)}(r::UnitRange{T}) = rand(RandIntGen(r))
rand{T}(r::Range{T}) = convert(T, first(r) + rand(0:(length(r)-1)) * step(r))
rand{T}(r::Range{T}) = convert(T, first(r) + rand(0:int(length(r)-1)) * step(r))

function rand!(g::RandIntGen, A::AbstractArray)
for i = 1 : length(A)
Expand Down

0 comments on commit bbfd711

Please sign in to comment.