Random number generator

Stacey Campbell staceyc at sco.COM
Fri Dec 29 15:18:31 AEST 1989


In article <940001 at hpavla.HP.COM>, gary at 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 at sco.com                                            \_.--._/
                                                                 v



More information about the Comp.lang.c mailing list