/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:33:18 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv pf=,p_sranus s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include #include #include "p_sranus.h" /* program DRSRANUS *>> 1995-10-23 DRSRANUS Krogh Reduced N to work on PC in D.P. *>> 1994-10-19 DRSRANUS Krogh Changes to use M77CON *>> 1992-03-13 DRSRANUS CLL * * Driver to demonstrate use of SRANUS to generate random numbers * from the uniform distribution between A and A+B. * Program computes histogram for N numbers * ------------------------------------------------------------------ *--S replaces "?": DR?RANUS, ?RANUS, ?STAT1, ?STAT2 * ------------------------------------------------------------------ */ /* PARAMETER translations */ #define N 8000 #define NCELLS (10 + 2) /* end of PARAMETER translations */ int main( ) { long int ihist[NCELLS]; float stats[5], ytab[N]; static float a = 20.0e0; static float b = 10.0e0; /* OFFSET Vectors w/subscript range: 1 to dimension */ long *const Ihist = &ihist[0] - 1; float *const Stats = &stats[0] - 1; float *const Ytab = &ytab[0] - 1; /* end of OFFSET VECTORS */ /* ------------------------------------------------------------------ */ Stats[1] = 0.0e0; /* Get array of scaled random numbers. * */ sranus( ytab, N, a, b ); /* Compute statistics and histogram. * */ sstat1( ytab, N, stats, ihist, NCELLS, a, a + b ); /* Print the statistics and histogram. * */ printf(" Uniform random numbers from SRANUS\n\n\n"); sstat2( stats, ihist, NCELLS, a, a + b ); exit(0); } /* end of function */