# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1336533782 14400 # Node ID 41d7e23f5734bc169e25408ed2eb086cb6ce0ee1 # Parent 3edba8b5f430ebdd456d9e5f1abfe4201fe09332 Document rand's seed difference from Matlab * rand.cc (Frand): Mention in docstring that seed is randomly chosen, not always fixed at startup. Give hint on how to obtain Matlab-like behaviour. diff -r 3edba8b5f430 -r 41d7e23f5734 src/DLD-FUNCTIONS/rand.cc --- a/src/DLD-FUNCTIONS/rand.cc Tue May 08 18:02:24 2012 -0700 +++ b/src/DLD-FUNCTIONS/rand.cc Tue May 08 23:23:02 2012 -0400 @@ -358,7 +358,10 @@ \n\ By default, the generator is initialized from @code{/dev/urandom} if it is\n\ available, otherwise from CPU time, wall clock time, and the current\n\ -fraction of a second.\n\ +fraction of a second. Note that this differs from @sc{Matlab}, which\n\ +always initializes the state to the same state at startup. To obtain\n\ +behavior comparable to @sc{Matlab}, initialize with a deterministic state\n\ +vector in Octave's startup files (@pxref{Startup Files}).\n\ \n\ To compute the pseudo-random sequence, @code{rand} uses the Mersenne\n\ Twister with a period of @math{2^{19937}-1} (See M. Matsumoto and\n\