Skip to content

Commit

Permalink
docs: disambiguate what rand((2, 3)) does (fix #33309)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfourquet committed Nov 1, 2019
1 parent ffdee15 commit 8e334b7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions stdlib/Random/src/Random.jl
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ Pick a random element or array of random elements from the set of values specifi
point numbers and to ``[0, 1)+i[0, 1)]`` for complex floating point numbers;
`S` defaults to [`Float64`](@ref).
When only one argument is passed besides the optional `rng` and is a `Tuple`, it is interpreted
as `S` and not as `dims`.
!!! compat "Julia 1.1"
Support for `S` as a tuple requires at least Julia 1.1.
Expand All @@ -330,6 +333,14 @@ julia> using Random
julia> rand(MersenneTwister(0), Dict(1=>2, 3=>4))
1=>2
julia> rand((2, 3))
3
julia> rand(Float64, (2, 3))
2×3 Array{Float64,2}:
0.999717 0.0143835 0.540787
0.696556 0.783855 0.938235
```
!!! note
Expand Down

0 comments on commit 8e334b7

Please sign in to comment.