Skip to content

Commit

Permalink
fix srand remains (in doc and NEWS) (#28364)
Browse files Browse the repository at this point in the history
  • Loading branch information
swissr authored and rfourquet committed Jul 31, 2018
1 parent b126677 commit a2e0b59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ Library improvements
* An official API for extending `rand` is now defined ([#23964], [#25002]).

* The constructor `MersenneTwister()` is re-enabled, producing a randomly initialized RNG
(similar to `srand(MersenneTwister(0))`) ([#21909]).
(similar to `Random.seed!(MersenneTwister(0))`) ([#21909]).

* `BitSet` can now store any `Int` (instead of only positive ones) ([#25029]).

Expand Down
4 changes: 2 additions & 2 deletions stdlib/Random/docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Random.rand(rng::AbstractRNG, ::Random.SamplerType{Die}) = Die(rand(rng, 4:20))

Scalar and array methods for `Die` now work as expected:

```jldoctest Die; setup = :(srand(1))
```jldoctest Die; setup = :(Random.seed!(1))
julia> rand(Die)
Die(18)
Expand All @@ -128,7 +128,7 @@ In order to define random generation out of objects of type `S`, the following m
`rand(rng::AbstractRNG, sp::Random.SamplerTrivial{S})`. Here, `sp` simply wraps an object of type `S`, which can be accessed via `sp[]`.
Continuing the `Die` example, we want now to define `rand(d::Die)` to produce an `Int` corresponding to one of `d`'s sides:

```jldoctest Die; setup = :(srand(1))
```jldoctest Die; setup = :(Random.seed!(1))
julia> Random.rand(rng::AbstractRNG, d::Random.SamplerTrivial{Die}) = rand(rng, 1:d[].nsides);
julia> rand(Die(4))
Expand Down

0 comments on commit a2e0b59

Please sign in to comment.