Skip to content
Permalink
Browse files

Compat annotations for #29670 (randperm and randcycle return type).

  • Loading branch information...
fredrikekre committed Nov 30, 2018
1 parent 4e65a1f commit e6474b9a40a9bc62a2bc8328ebab6bd4850f08df
Showing with 8 additions and 0 deletions.
  1. +8 −0 stdlib/Random/src/misc.jl
@@ -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)
@@ -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)

0 comments on commit e6474b9

Please sign in to comment.
You can’t perform that action at this time.