[fpc-pascal] Re: Why is Random(255) some 529x slower compared to Delphi 7?
Virgo Pärna
virgo.parna at mail.ee
Fri Dec 9 11:54:14 CET 2011
On Fri, 09 Dec 2011 09:19:53 +0100, Florian Klaempfl <florian at freepascal.org> wrote:
>
> Oops, mails crossed. The assignment to randseed is indeed the problem.
> Why is it done? Bad random generator of delphi :)?
>
I don't know, how bad Delphis random generator is, but I once years ago did make a mistake
of calling randomize before random. It was a school assignment for using Turbo Pascal graphics.
So I made program, that was supposed to fill screen with random dots (colour was also set with
random). Anyway, when I called randomize before random, then as a result dots didn't fill the
screen, but were mostly along the diagonal of the screen. So I'd guess, that setting randseed
multiple times could be actually bad for randomness of results. Or maybe modern algorithms are
better at situations like this?
--
Virgo Pärna
virgo.parna at mail.ee
More information about the fpc-pascal
mailing list