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 c47f194 commit 4b4747d096c2d5e1820622d27af2f08c274d8b8b
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 4b4747d

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