/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:33:12 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv pf=,p_dran s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include #include #include "p_dran.h" /* program drdran *>> 2001-07-16 DRDRAN Krogh Added comma in two fomrats. *>> 1996-06-19 DRDRAN Krogh Minor format change for C conversion. *>> 1994-10-19 DRDRAN Krogh Changes to use M77CON *>> 1992-02-24 DRDRAN CLL *>> 1987-12-10 Original time stamp *--D replaces "?": DR?RAN, ?RANUA *++S Default NDIG = 6 *++ Default NDIG = 12 *++ Replace "f15.12" = "f"//NDIG+3//"."//NDIG * Reports MODE for host system, and prints a few integers in the * integer sequence underlying the pseudorandom number package for * the MATH77 library. These integers should be exactly the * same on all host systems. The listed integers include the * smallest and largest in the entire sequence. * ------------------------------------------------------------------ */ int main( ) { long int i, kase, mode, _i, _r; static long int kseed[2][2]; double x[1]; static int _aini = 1; /* OFFSET Vectors w/subscript range: 1 to dimension */ double *const X = &x[0] - 1; /* end of OFFSET VECTORS */ if( _aini ){ /* Do 1 TIME INITIALIZATIONS! */ kseed[0][0] = 249979; kseed[0][1] = 65550; kseed[1][0] = 437215; kseed[1][1] = 10953; _aini = 0; } /* ------------------------------------------------------------------ */ for (kase = 1; kase <= 2; kase++) { printf(" \n\n Integer sequence Number returned\n \n"); printf(" %7ld,%5ld\n", kseed[kase - 1][0], kseed[kase - 1][1]); ranput( &kseed[kase - 1][0] ); for (i = 1; i <= 10; i++) { dranua( x, 1 ); ranget( &kseed[kase - 1][0] ); printf(" %7ld,%5ld %15.12f\n", kseed[kase - 1][0], kseed[kase - 1][1], X[1]); } } rn2( &mode ); printf("\n MODE may be 2, 3, or 4. On the current host it is %2ld\n", mode); exit(0); } /* end of function */