Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site cubsvax.UUCP
Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!mhuxj!mhuxr!ulysses!allegra!mit-eddie!godot!harvard!seismo!cmcl2!rna!cubsvax!peters
From: peters@cubsvax.UUCP (Peter S. Shenkin)
Newsgroups: net.bugs,net.unix,net.lang.c,net.math
Subject: Bug in rand() and srand()
Message-ID: <320@cubsvax.UUCP>
Date: Fri, 1-Mar-85 11:15:44 EST
Article-I.D.: cubsvax.320
Posted: Fri Mar  1 11:15:44 1985
Date-Received: Mon, 4-Mar-85 04:52:13 EST
Reply-To: peters@cubsvax.UUCP (Peter S. Shenkin)
Organization: Columbia Univ Biology, New York City
Lines: 11
Xref: watmath net.bugs:557 net.unix:3801 net.lang.c:4605 net.math:1872

In attempting to use these functions under 4.1bsd on a VAX/780, I found that
rand() returns strictly alternating even and odd numbers, regardless of
seed!!!  So I went and tried the same thing on a 4.2bsd system, and found
the same behavior.  

It may be that this has already been hashed out in some
of the above newsgroups, but since I only read net.lang.c among them I will
have missed the discussion.  If anyone has a rewritten rand(), or other
advice, I'd appreciate being mailed a fix.

Thanks,  Peter S. Shenkin,   {philabs,cmcl2!rna}!cubsvax!peters