Random number generator flawed?

Mark L. Stevans ms at ccieng5.UUCP
Thu Oct 13 07:10:13 AEST 1983


Some kind soul (a little too kind for my reputation) pointed out an
inconsistency in my random number generator between the expression
(2 << 15) and the comment "2**15".  Once again, we see the dangers of
comments.  No one would have noticed if I didn't try to be thorough.

Anyway, the problem is that I don't have the IBM manual, so I don't know
which is the correct one.  I will attempt to make myself go to the University
of Rochester math library and recheck my algorithm.  In the meantime, don't
use my random number generator in life or death situations.

				Chagrinedly, shamefully, Pseudonymously,
				Stevan Marks

PS: I suspect the comment is correct, the code incorrect, but I haven't
tried changing it yet.



More information about the Comp.lang.c mailing list