Skip to content

Commit

Permalink
Compat annotations for #29670 (randperm and randcycle return type).
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Dec 4, 2018
1 parent c47f194 commit 4b4747d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions stdlib/Random/src/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ of `n`.
To randomly permute an arbitrary vector, see [`shuffle`](@ref) or
[`shuffle!`](@ref).
!!! compat "Julia 1.1"
In Julia 1.1 `randperm` returns a vector `v` with `eltype(v) == typeof(n)`
while in Julia 1.0 `eltype(v) == Int`.
# Examples
```jldoctest
julia> randperm(MersenneTwister(1234), 4)
Expand Down Expand Up @@ -322,6 +326,10 @@ Construct a random cyclic permutation of length `n`. The optional `rng`
argument specifies a random number generator, see [Random Numbers](@ref).
The element type of the result is the same as the type of `n`.
!!! compat "Julia 1.1"
In Julia 1.1 `randcycle` returns a vector `v` with `eltype(v) == typeof(n)`
while in Julia 1.0 `eltype(v) == Int`.
# Examples
```jldoctest
julia> randcycle(MersenneTwister(1234), 6)
Expand Down

0 comments on commit 4b4747d

Please sign in to comment.