[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bad random numbers
From: |
lash |
Subject: |
Re: bad random numbers |
Date: |
Wed, 14 Jul 1999 10:32:17 -0500 (CDT) |
>
> I think it would be good to have Bill Lash's code incorporated in the
> standard octave source. I'm assuming it does what it's supposed to do and
> won't cause problems on other systems.
>
Well, the change does give "random looking" results for successive runs
in a while loop without the need to seed, but I wrote it to mimic the behavior
of the
loop that uses the time to seed the random number generator. As I said in
the last message, this will not give better results if the platform
does not have gettimeofday().
The patch also uses the trick that the seeding routine of the random number
generator uses, where the two integers that are needed to seed the RNG are
developed by taking a double floating point number and using the upper
and lower 32 bits as integers. I won't speculate as to whether this is
good or not, it seems to work, so I guess it isn't terrible.
The original initialization code seemed to make an effort to provide
different numbers for each second, so it might make sense to keep this
basic behavior, but add in the fractional second stuff so that the number
has more appearance of being random.
If John wants to incorporate the patch, that is fine by me, but remember
that it was a quick hack, and that it does have some limitations.
Bill Lash
address@hidden
---------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL. To ensure
that development continues, see www.che.wisc.edu/octave/giftform.html
Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html
---------------------------------------------------------------------
- Re: bad random numbers, (continued)
- Re: bad random numbers, Mike Miller, 1999/07/13
- Re: bad random numbers, John W. Eaton, 1999/07/13
- Re: bad random numbers, Mike Miller, 1999/07/13
- Re: bad random numbers, John W. Eaton, 1999/07/13
- Re: bad random numbers, A+A Adler, 1999/07/13
- Re: bad random numbers, Mike Miller, 1999/07/13
- Re: bad random numbers, John Judge, 1999/07/13
- Re: bad random numbers, lash, 1999/07/13
- Re: bad random numbers, Mike Miller, 1999/07/14
- Re: bad random numbers,
lash <=
- Re: bad random numbers, Jim Van Zandt, 1999/07/14
- Re: bad random numbers, John W. Eaton, 1999/07/14
- Re: bad random numbers, Thomas Walter, 1999/07/14
- Re: bad random numbers, Eric Ortega, 1999/07/15
Re: bad random numbers, Jim Van Zandt, 1999/07/14
Re: bad random numbers, John Smith, 1999/07/14
Re: bad random numbers, heberf, 1999/07/13