-#undef RAN
-long fRAN(long RANGE) {
-static long D, R = 0, RAN, T;
-
-/* Since the ran function in LIB40 seems to be a real lose, we'll use one of
- * our own. It's been run through many of the tests in Knuth vol. 2 and
- * seems to be quite reliable. RAN returns a value uniformly selected
- * between 0 and range-1. */
-
-
- D=1;
- if(R != 0 && RANGE >= 0) goto L1;
- DATIME(D,T);
- R=MOD(T+5,1048576L);
- D=1000+MOD(D,1000);
-L1: for (T=1; T<=D; T++) {
- R=MOD(R*1093L+221587L,1048576L);
- } /* end loop */
- RAN=(RANGE*R)/1048576;
- return(RAN);