/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:33:14 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv pf=,p_ran1 s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include #include #include "p_ran1.h" int main( ) { long int i, ksize; float x[5], y[5]; /* OFFSET Vectors w/subscript range: 1 to dimension */ float *const X = &x[0] - 1; float *const Y = &y[0] - 1; /* end of OFFSET VECTORS */ /*>> 1996-05-28 DRRAN1 Krogh Added external statement. *>> 1992-05-15 CLL Added after final END. *>> 1992-03-13 CLL * Demo driver for RAN1 and RANSIZ * Also references SRANU, SRANG, SRANUA * ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */ ransiz( &ksize ); printf(" DRRAN1.. Demo driver for RAN1 and RANSIZ.\n\n RANSIZ returns KSIZE = %3ld\n", ksize); sranua( x, 3 ); X[4] = sranu(); X[5] = srang(); ran1(); sranua( y, 3 ); Y[4] = sranu(); Y[5] = srang(); for (i = 1; i <= 5; i++) { if (X[i] != Y[i]) { printf("\n Reinitialization of the random number generators by use\n" " of RAN1 failed. The following two floating-point\n" " numbers should have been identical.\n %2ld%14.6g%14.6g\n", i, X[i], Y[i]); exit(0); } } printf("\n Reinitialization of the random number generators by use\n of RAN1 succeeded.\n"); exit(0); } /* end of function */