Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ll-xn!cit-vax!trent From: trent@cit-vax.Caltech.Edu (Ray Trent) Newsgroups: net.sources Subject: Re: mz.c Message-ID: <1125@cit-vax.Caltech.Edu> Date: Wed, 5-Nov-86 22:56:50 EST Article-I.D.: cit-vax.1125 Posted: Wed Nov 5 22:56:50 1986 Date-Received: Thu, 6-Nov-86 03:06:27 EST References: <4247@ism780c.UUCP> <823@zen.BERKELEY.EDU> Reply-To: trent@cit-vax.UUCP (Ray Trent) Organization: California Institute of Technology Lines: 17 In article <823@zen.BERKELEY.EDU> chapman@cory.Berkeley.EDU.UUCP (Brent Chapman) writes: >Anyway, the definition of macro oneof() needs to be changed from: > #define oneof(n) (int)(((long)(n) * rand())/32768) >to: > #define oneof(n) (int)(((long)(n) * (rand() & 0x7fff))/32768) I suppose this works...but isn't: #define oneof(n) (rand() % (n) + 1) more intuitive and efficient? -- DISCLAIMER, DAMMIT!!!! Any errors in this posting are computer errors generated by my spelling/syntax/usage/factual content checker. ../ray\.. (trent@csvax.caltech.edu, rat@caltech.bitnet, ...seismo!cit-vax!trent)