Skip to content

Commit

Permalink
document the numeric argument in srand(rng, filename, n=4)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfourquet committed Apr 1, 2017
1 parent ad66758 commit 8d82fc6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions base/random.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,13 @@ end

"""
srand([rng=GLOBAL_RNG], [seed]) -> rng
srand([rng=GLOBAL_RNG], filename, n=4) -> rng
Reseed the random number generator. If a `seed` is provided, the RNG will give a
reproducible sequence of numbers, otherwise Julia will get entropy from the system. For
`MersenneTwister`, the `seed` may be a non-negative integer, a vector of `UInt32` integers
or a filename, in which case the seed is read from a file. `RandomDevice` does not support
seeding.
or a filename, in which case the seed is read from a file (`4n` bytes are read from the file,
where `n` is an optional argument). `RandomDevice` does not support seeding.
"""
srand(r::MersenneTwister) = srand(r, make_seed())
srand(r::MersenneTwister, n::Integer) = srand(r, make_seed(n))
Expand Down

0 comments on commit 8d82fc6

Please sign in to comment.