From: pfay AT acl DOT lanl DOT gov (Patrick J. Fay) Subject: Random number generator 8 Jan 1998 02:18:57 -0800 Message-ID: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII To: BMullenber AT aol DOT com Cc: gnu-win32 AT cygnus DOT com Try: PREINSTALLED /pfay/memory 262 > cat tst.c #include #include int rand100() { double rmax=100.0/RAND_MAX; return((int)(rmax*(rand()))); } int main() { int i; for(i=0;i<10;i++) { printf("rand100=%d\n",rand100()); } return 0; } PREINSTALLED /pfay/memory 263 > !gc gcc tst.c -o tstc PREINSTALLED /pfay/memory 264 > !./t ../tstc rand100=51 rand100=17 rand100=30 rand100=53 rand100=94 rand100=17 rand100=70 rand100=22 rand100=49 rand100=12 Patrick Fay, Ph.D., Intel Corp. email: pfay AT co DOT intel DOT com Los Alamos National Lab wk: (505) 665-9141 CTI M.S. B296 fax: (505) 667-5921 Los Alamos NM 87545 ASCI-RED http://www.acl.lanl.gov/~pfay/teraflop - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".