[eu-gene] ansi randomness

David Hart dahart at gmail.com
Wed May 10 23:32:26 BST 2006


Friends don't let friends call ANSI rand().

Seriously.

--
david.


On 5/9/06, Dave Griffiths <dave at pawfal.org> wrote:
> I'm always find it quite amusing (ok, so maybe it's just me) at how small
> "random" implementations are. This one is an ansi implementation from
> MinGW, but they are all pretty similar:
>
> randomnumber = lastrandomnumber * 6364136223846793005 + 1
>
> and seeding it just assigns the seed to lastrandomnumber.
>
> So (as it has been stated) the randomness comes entirely from our
> interpretation - or the limits thereof, not the software, which as usual
> is pretty dumb.
>
> I've seen times when it breaks down and produces recognisable patterns,
> but only in extreme cases - when seeding it by an incrementing number and
> only calling rand() once or twice for each seed for instance.
>
> dave
>
> --
> 'Douglas Hofstadter believes he is a strange loop, and who am I to disagree?'
> To unsubscribe from eu-gene visit
> http://www.generative.net/mailman/listinfo/eu-gene
>



More information about the eu-gene mailing list