Re: Anyone need a random number generator?

Ron Hudson <[email protected]>
Newsgroups gmane.comp.emulators.turnkey-mvs
Message-ID <[email protected]>
Here are better numbers....

C RANDOM NUMBER GENERATOR
      FUNCTION IRND(ISEED)
      INTEGER IY
      IY = IABS(MOD(31421 * ISEED + 6927,2**15))
      IRND = IY
      RETURN
      END

I must have been suffering overflow much more than I though.



On Thu, Apr 29, 2010 at 8:54 AM, Ron Hudson <[email protected]> wrote:

> Well it looks like the parameters I found turn out to be a spectacularly
> bad PRNG..
>
>
>    - I collect pairs of random numbers between 1 and 40, use them as X,Y
>    indexes to increment cells of an array.
>    - do the above until the increment takes one of the cells to 100
>    - Print out the array
>
> I find cells get incremented to 99 in a sea of zeros  (32 "islands" of 99)
> and a smattering of 1s and 2s
>
> : ^ (
>
> Is there a system function or insintric or some way to get -good- random
> numbers?
>
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.