Path: 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 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