Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 4/3/85; site ukecc.UUCP Path: utzoo!watmath!clyde!cbosgd!ukma!ukecc!edward From: edward@ukecc.UUCP (Edward C. Bennett) Newsgroups: net.unix Subject: Re: Is there a UNIX SVR2 random/srandom equivalent? Message-ID: <157@ukecc.UUCP> Date: Sun, 14-Jul-85 16:21:04 EDT Article-I.D.: ukecc.157 Posted: Sun Jul 14 16:21:04 1985 Date-Received: Sat, 20-Jul-85 08:18:35 EDT References: <1244@hound.UUCP> <11392@brl-tgr.ARPA> <2399@sun.uucp> <156@ukecc.UUCP> Organization: Univ. of Ky. Engineering Computing Center Lines: 20 Summary: A clarification In article <156@ukecc.UUCP>, edward@ukecc.UUCP (Edward C. Bennett) writes: > In article <2399@sun.uucp>, guy@sun.uucp (Guy Harris) writes: > > > > Does anyone know what I should use in place of random and srandom? > > > > In particular, while BSD and sysV RNGs both return ints, you > must pay attention to what an int is. On a local VAX 11/750 an int is 4 > bytes. On our 3B20S an int is 2 bytes. > Usually this won't make any difference, but every now and then > you'll probably find a program where it does. It seems that I spoke too soon. Ints on our 3B20S are indeed 4 bytes long. rand() returns a 4 byte value BUT (this is the catch) the value is masked to its lower 15 bits yeilding 0 <= rand() <= 32767. -- Edward C. Bennett UUCP: ihnp4!cbosgd!ukma!ukecc!edward /* A charter member of the Scooter bunch */