Skip to content

Commit

Permalink
Merge pull request #1881 from andreasnoackjensen/randomrepro
Browse files Browse the repository at this point in the history
RFC: Reproducible random numbers
  • Loading branch information
ViralBShah committed Jan 3, 2013
2 parents cccc489 + 370f033 commit d5ad594
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions base/rng.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ function srand(seed::Vector{Uint32})
dsfmt_gv_init_by_array(seed)
end

srand(seed::Uint64) = srand([uint32(seed),uint32(seed>>32)])
srand(seed::Vector{Int32}) = srand(uint32(seed))
srand(seed::Vector{Int64}) = srand(int32(seed))
srand(seed::Int32) = srand(uint32(seed))
srand(seed::Int64) = srand(uint64(seed))
srand(seed::Int64) = srand(int32(seed))

function srand(filename::String, n::Integer)
open(filename) do io
Expand Down

0 comments on commit d5ad594

Please sign in to comment.