On Sun, Feb 02, 2003 at 01:59:25PM -0800, Bakul Shah wrote:
> 
> AFAIK all random(3) implementations in various versions of
> Unix come from Earl's original 4.2BSD implementation so in my
> view the _expected_ behavior is to see the _exact_ same
> sequence starting from a given seed.  This function is called
> "random()" but it is equivalent to a mathematical function
> which must provide the same sequence for the exact same
> input.
> 

I was going to stay out of this, but 

#include <stdio.h>
#include <stdlib.h>
int main(void) {
  int i;
  long x;
  x = 100L;
  srandom(x);
  for (i = 0; i < 1010; i++) {
     x = random();
     printf("%ld\n", x);
  }
  return 0;
}

Last 10 digits.

 FreeBSD       Redhat       SunOS 
660787754    660787754    645318364
327548691    327548691    1583150371
2009993994   2009993994   715222008
1653966416   1653966416   1349166998
1074113008   1074113008   566227131
2142626740   2142626740   1382825076
1517775852   1517775852   583981903
1453318125   1453318125   1453942393
619607807    619607807    1952958724
199986393    199986393    1599163286

-- 
Steve

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to