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

RFC support for rand(Ranges) and rand(Ranges,dims) #5059

Merged
merged 1 commit into from
Dec 12, 2013

Conversation

ggggggggg
Copy link
Contributor

previously rand accepted only Range1{T<:Integer}
closes #5041

allows things like

julia> rand(1:1//2:10,1,5)
1x5 Array{Rational{Int64},2}:
 19//2  19//2  2//1  8//1  17//2
julia> rand(1:7:100,1,5)
1x5 Array{Int64,2}:
 57  92  15  99  50

I left in most of the specific Range1{T<:Integer} code because I wasn't sure about performance.

previously rand accepted only Range1{T<:Integer}
JeffBezanson added a commit that referenced this pull request Dec 12, 2013
RFC support for rand(Ranges) and rand(Ranges,dims)
@JeffBezanson JeffBezanson merged commit af2e4a9 into JuliaLang:master Dec 12, 2013
@ViralBShah ViralBShah added the randomness Random number generation and the Random stdlib label Nov 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
randomness Random number generation and the Random stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request rand support Range not just Range1
3 participants