🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.dec
Article #1664

Re: Random numbers on PDP-11

#1664
From: Martin Minow
Date: Wed, 04 Jul 1990 17:51
20 lines
1067 bytes
In article <19191@orstcs.CS.ORST.EDU> kohler@jacobs.CS.ORST.EDU
(kurt kohler) writes:
>  We have the need to generate some small (< 100) integers on the
>PDP-11.  It doesn't need to be of terribly high quality.

	/*
	 *	The algorithm is based on the mth$random function in the
	 *	VMS common run-time library.
	 *
	 *	Note that the algorithm is prone to nonrandom sequences when
	 *	considering the next pseudorandom number.
	 */
	static long seed = 123456789L;
	long rand() {
	    seed = (69069L * seed + 1);
	    return (seed & 0x7FFFFFFF);
	}

Martin Minow
minow@bolt.enet.dec.com
Technical Details
Message-ID: <1739@mountn.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!mountn.dec.com!minow
References: <19191@orstcs.CS.ORST.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!mountn.dec.com!minow
From: minow@mountn.dec.com (Martin Minow)
Newsgroups: comp.sys.dec
Subject: Re: Random numbers on PDP-11
Keywords: PDP-11 random numbers
Message-ID: <1739@mountn.dec.com>
Date: 4 Jul 90 17:51:57 GMT
References: <19191@orstcs.CS.ORST.EDU>
Reply-To: minow@bolt.enet.dec.com (Martin Minow)
Distribution: na
Organization: Digital Equipment Corporation
Lines: 20