[kw-pm] Seeding srand

Max max at alleged.net
Wed Feb 9 08:07:01 PST 2011


Changing the seed won't really affect the output distribution.  That 
would seem to be a limitation in rand().


On 2/9/2011 11:02 AM, Robert Pike wrote:
> Trying to get a good seed value for an app I'm working on. The app will be running on both windows and linux. The rand function will only be looking at numbers between 0 and 3 (inclusive).
> Right now I'm using time ^ $$. The funny thing is when I run on one server the results skew "greatly" towards the extremes (i.e. 0 or 3 - slighly more than 75% of the random numbers generated are 0 or 3). On another server the number 3 has never gotten hit after over 200 trial runs. Both servers are Windows machines.
> Appreciate any feedback anyone can give. Thanks.
>
>
> _______________________________________________
> kw-pm mailing list
> kw-pm at pm.org
> http://mail.pm.org/mailman/listinfo/kw-pm



More information about the kw-pm mailing list