This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [gfortran] PATCH -- Fix segfault in RANDOM_SEED.
Actually I skipped some priming, I'd better put it back in ... I will also look at the put sequence if I have forgotten something.
Basicly, the only 'really' bad sequence should be a string of zeroe's ... everything else should run fine, I will look at it again.
/ Lars Segerlund.
On Sun, 23 May 2004 18:49:58 +0100
Paul Brook <paul@codesourcery.com> wrote:
> On Sunday 23 May 2004 17:05, Steven G. Kargl wrote:
> > This patch fixes a segfault when using the PUT
> > argument of RANDOM_SEED. There, however, is a
> > major problem with the current PRNG. This
> > simple program appears to trigger an alarmingly
> > bad sequence of numbers.
>
> It looks like this could be a known problem with the generator. A poor (not
> very random) seed will give poor generated numbers.
>
> Also, the first 600 numbers returned will be the seed values (cast to unsigned
> int, then converted back to a float).
>
> The way we convert from int to float (discard least significant bits) may
> exaggerate the problem in this case.
>
> I also noticed that random_seed(get) changes the sequence of random numbers.
> This is now PR15619.
>
> > 2004-05-23 Steven G. Kargl <kargls@comcast.net>
> > * random.c (random_seed): Use correct variable.
>
> Applied, thanks.
>
> Paul