From 1caba8a840cb18acc94a2590a83e42e9c4d7519d Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 30 Nov 2018 19:29:09 +0100 Subject: [PATCH] Compat annotations for #29670 (randperm and randcycle return type). --- stdlib/Random/src/misc.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stdlib/Random/src/misc.jl b/stdlib/Random/src/misc.jl index 19689613d387f..1922c5c066b62 100644 --- a/stdlib/Random/src/misc.jl +++ b/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)