JuliaLang/julia — pull request #3008 by GunnarFarneback (2013-05-03 18:47:47+00:00)
Title: Repair rand{T<:Integer}(r::Range1{T}) for signed types. Closes #3004.

This pull request restores the rand(r::Range1) function to the state before https://github.com/JuliaLang/julia/commit/6e6b05750ee572699e186b9deecdc5eee5608004#base/random.jl to solve the regression reported in #3004. There are other edge case issues in the function but I'll come back to those at a later time.

I'm not sure about the value of the testcase. Generating 100000 random numbers to test this specific problem is maybe not motivated. What this patch really needs is careful code review.