🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by utzoodecvaxharponpoiveisxwhuxlbe... Tue, 22 Mar 1983 17:43
Re: non-randomness in rand() - (nf)
#83
Author: utzoodecvaxharponpoiveisxwhuxlbe...
Date: Tue, 22 Mar 1983 17:43
37 lines
931 bytes
#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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads