× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Try a seed of "roxanne"

Sorry - couldn't resist.

I have found the same thing. Try using 0 for the seed each time - then it
generates its own seed from the Greenwich Mean Time.

I've tried various schemes. I incremented the returned seed by 1, testing
for overflow after to 2,147,483,646. But I don't know enough about the
method used, the "multiplicative congruential" method, according to the API
manual.

There are other random number generators on the 400. One is the rand()
function of C/C++. There is also the CIPHER MI instruction - it is exposed
to use in ILE programs. Lots of luck finding documentation. I'll look in my
MI reference - but Leif might know something here. I think it generates a
key - it might be possible to interpret it as other data types.

There's also one in later versions of SQL.

At 04:06 PM 9/16/02 -0700, you wrote:
We've been playing with CEERANO to try to construct a list of 13 digit
unique numbers in "random" order.  It looks like that after 20,000 or so,
diminishing returns sets in in a big way.

What we're doing is starting with zero as the seed and using whatever gets
returned in the seed parm as the next seed.  The test program looks at its
output file to see if the current random number is in the file.  If not, it
writes it.  Out of curiosity I tried a run of 99,999--off by 1 <g>--just to
see what I'd get.  1322 of the numbers occurred 70 times, 29 of them
occurred 69 times, and the others occurred once.  I guess I'd expect the
frequencies to be a little more normally distributed.

Looks like using the seed value returned by the function is not a good idea.
Does anyone know what's happening here?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.