1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>SEED Seed the Random Number Generator
</TITLE>
</HEAD>
<BODY>
<H2>SEED Seed the Random Number Generator
</H2>
<P>
Section: <A HREF=sec_random.html> Random Number Generation </A>
<H3>Usage</H3>
Seeds the random number generator using the given integer seeds.
Changing the seed allows you to choose which pseudo-random
sequence is generated. The seed takes two <code>uint32</code> values:
<PRE>
seed(s,t)
</PRE>
<P>
where <code>s</code> and <code>t</code> are the seed values. Note that due to limitations
in <code>ranlib</code>, the values of <code>s,t</code> must be between <code>0 <= s,t <= 2^30</code>.
<H3>Example</H3>
Here's an example of how the seed value can be used to reproduce
a specific random number sequence.
<PRE>
--> seed(32,41);
--> rand(1,5)
ans =
0.8589 0.3727 0.5551 0.9557 0.7367
--> seed(32,41);
--> rand(1,5)
ans =
0.8589 0.3727 0.5551 0.9557 0.7367
</PRE>
<P>
</BODY>
</HTML>
|