M
Mark McDougall
Guest
Hi,
I'm attempting to generate the same sequence of pseudo-random numbers
twice - once to create a test data set and a second time to verify it.
Here's what I'm doing...
$random (42);
for (i=0; i<7; i=i+1)
data1 = $random;
$random (42)
for (i=0; i<7; i=i+1)
data2 = $random;
If I print the return value from $random(42), in both cases it is the
same value.
However, the sequence assigned to data2 does not match the sequence
assigned to data1.
What am I doing wrong? It's the sort of thing I do in C all the time. Do
I misunderstand how the $random system task is supposed to work?
Regards,
Mark
I'm attempting to generate the same sequence of pseudo-random numbers
twice - once to create a test data set and a second time to verify it.
Here's what I'm doing...
$random (42);
for (i=0; i<7; i=i+1)
data1 = $random;
$random (42)
for (i=0; i<7; i=i+1)
data2 = $random;
If I print the return value from $random(42), in both cases it is the
same value.
However, the sequence assigned to data2 does not match the sequence
assigned to data1.
What am I doing wrong? It's the sort of thing I do in C all the time. Do
I misunderstand how the $random system task is supposed to work?
Regards,
Mark