From 1723f2cb9e7f3f1a075a284b70506370c4212737 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 19689613d387f4..1922c5c066b624 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)