Mail Archives: cygwin/1998/01/08/02:18:57
Try:
PREINSTALLED /pfay/memory 262 > cat tst.c
#include <stdlib.h>
#include <math.h>
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".
- Raw text -