From 370f0334a3ad0e6c8c8e44a6e2c7ab041a960f67 Mon Sep 17 00:00:00 2001 From: Andreas Noack Jensen Date: Thu, 3 Jan 2013 07:36:51 +0100 Subject: [PATCH] Change seed functions to give the same random numbers on 64 and 32 bit machines. --- base/rng.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/base/rng.jl b/base/rng.jl index 329761dbecbef..8950265d755a8 100644 --- a/base/rng.jl +++ b/base/rng.jl @@ -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