🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs
Article #403

Bug in rand() and srand()

#403
From: Peter S. Shenkin
Date: Fri, 01 Mar 1985 16:15
11 lines
1230 bytes
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
Technical Details
Message-ID: <320@cubsvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!ihnp4!houxm!mhuxj!mhuxr!ulysses!allegra!mit-eddie!godot!harvard!seismo!cmcl2!rna!cubsvax!peters

Show Full Headers
Complete Article Headers
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: arc1-ca.pugleaf.net!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