Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!sco!staceyc From: staceyc@sco.COM (Stacey Campbell) Newsgroups: comp.lang.c Subject: Re: Random number generator Message-ID: <943@scorn.sco.COM> Date: 29 Dec 89 04:18:31 GMT Sender: news@sco.COM Reply-To: staceyc@sco.COM (Stacey Campbell) Organization: The Santa Cruz Operation, Inc. Lines: 11 In article <940001@hpavla.HP.COM>, gary@hpavla.HP.COM (Gary Jackoway) writes: >I was trying to generate a random number bewteen 0 and maxlongint (i.e. 2^32) Stop using rand(). The Unix version you are using has an excellent pseudo-random number generator in the C library. Check the man page for drand48(). Long random numbers are returned by lrand48(). -- Stacey Campbell _--_|\ {uunet,ucscc,decwrl,att,microsoft,wyse}!sco!staceyc / \ staceyc@sco.com \_.--._/ v