[8197] in Athena Bugs
Re: decmips 7.3M: fortran
daemon@ATHENA.MIT.EDU (epeisach@MIT.EDU)
Sat Sep 14 17:51:00 1991
From: epeisach@MIT.EDU
Date: Sat, 14 Sep 91 17:51:32 -0400
To: oliver@MIT.EDU
Cc: bugs@MIT.EDU, ellis@MIT.EDU
In-Reply-To: [8195]
You were trying to
> Use the random and drandm library functions.
And stated that they were not found.
The intro 3f man page lies. It is more applicable to the vax platform I
suspect. I have checked the libraries from the old fortran compiler and
determined that the random, drandm functions were missing in the old
compiler as well as the flmin, flmax, ffrac routines.
Enclosed are the sources for random and drandm:
Ezra
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* @(#)random_.c 5.3 10/30/86
*
* Routines to return random values
*
* calling sequence:
* double precision d, drandm
* i = irandm(iflag)
* x = random(iflag)
* d = drandm(iflag)
* where:
* If arg is nonzero, generator is restarted and value is returned.
* If arg is 0, next value is returned.
* Integer values will range from 0 thru 2147483647 (see random(3)).
* Real values will range from 0.0 thru 1.0 .
*/
#if defined(vax) || defined(tahoe) || defined(mips)
#define RANDMAX 2147483647
#else vax || tahoe
UNKNOWN MACHINE!
#endif vax || tahoe
long irandm_(iarg)
long *iarg;
{
if (*iarg) srandom((int)*iarg);
return( random() );
}
float random_(iarg)
long *iarg;
{
if (*iarg) srandom((int)*iarg);
return( (float)(random())/(float)RANDMAX );
}
double drandm_(iarg)
long *iarg;
{
if (*iarg) srandom((int)*iarg);
return( (double)(random())/(double)RANDMAX );
}