From 8869fd900bd75dd27bc12275ffede4b09c127230 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 30 Nov 2018 00:47:55 +0100 Subject: [PATCH] News and compat annotation for #30090 (sprand with specified type). --- NEWS.md | 2 +- stdlib/SparseArrays/src/sparsematrix.jl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index fdfa82dac7ffa..c97ced87eba7a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -36,7 +36,7 @@ Standard library changes * `range` can accept the stop value as a positional argument, e.g. `range(1,10,step=2)` ([#28708]). * `edit` can now be called on a module to edit the file that defines it ([#29636]). * `diff` now supports arrays of arbitrary dimensionality and can operate over any dimension ([#29827]). - * `sprandn` now supports result types like `ComplexF64` or `Float32` ([#30083]). + * `sprandn` now supports specifying the output element type ([#30083]). * The constructor `BigFloat(::BigFloat)` now respects the global precision setting and always returns a `BigFloat` with precision equal to `precision(BigFloat)` ([#29127]). The optional `precision` argument to override the global setting is now a keyword instead of positional diff --git a/stdlib/SparseArrays/src/sparsematrix.jl b/stdlib/SparseArrays/src/sparsematrix.jl index 572b6daa2eeef..c4b335701400d 100644 --- a/stdlib/SparseArrays/src/sparsematrix.jl +++ b/stdlib/SparseArrays/src/sparsematrix.jl @@ -1478,6 +1478,9 @@ with the specified (independent) probability `p` of any entry being nonzero, where nonzero values are sampled from the normal distribution. The optional `rng` argument specifies a random number generator, see [Random Numbers](@ref). +!!! compat "Julia 1.1" + Specifying the output element type `Type` requires at least Julia 1.1. + # Examples ```jldoctest; setup = :(using Random; Random.seed!(0)) julia> sprandn(2, 2, 0.75)