non-randomness in rand() - (nf)
utzoo!decvax!harpo!npoiv!eisx!whuxlb!eric
utzoo!decvax!harpo!npoiv!eisx!whuxlb!eric
Tue Mar 22 17:43:54 AEST 1983
#R:p500vax:-17800:whuxlb:1800003:000:484
whuxlb!eric Mar 22 17:22:00 1983
***** whuxlb:net.bugs / p500vax!pat / 8:39 pm Mar 18, 1983
rand(), the random number generator in the UNIX library, returns
alternating even and odd numbers.
----------
well, i'm running UNIX 5.0, and here is my program:
main() {
while (1) printf("%ld\n",rand());
}
and sample output:
16838
5758
10113
17515
31051
5627
23010
7419
16212
4086
2749
12767
9084
looks pretty distributed to me!?! maybe you're running
a different UNIX???
Eric Holtman
harpo!whuxlb!eric
More information about the Net.bugs
mailing list