random numbers

Shiping Zhang ping at cubmol.BIO.COLUMBIA.EDU
Tue Aug 22 01:23:47 AEST 1989


In article <876.24EFA953 at busker.FIDONET.ORG> Rik.Stevans at f226.n105.z1.FIDONET.ORG (Rik Stevans) writes:
>Does anyone have a good random number generator for 'c'?  i need a 
>function which will return an integer less than zero (just like rnd 
>in basic) and be fairly random.  the one i wrote does ok but is very 
>unweildly as i cast from double back to int to get the numbers i need. 
>thanks, rik s...
>--  
>Rik Stevans - via FidoNet node 1:105/14
>	    UUCP: ...!{uunet!oresoft, tektronix!reed}!busker!226!Rik.Stevans
>	    ARPA: Rik.Stevans at f226.n105.z1.FIDONET.ORG


There are functions that generate random integers in the C standard
library. Take a look at your manual.


-ping



More information about the Comp.lang.c mailing list