[kw-pm] Seeding srand
Robert Pike
roberthpike at yahoo.com
Wed Feb 9 08:02:57 PST 2011
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.
More information about the kw-pm
mailing list