/************************************************************************/ /* */ /* modmult routine for SUN-4. Computes (A*B)/C and Mod C */ /* */ /************************************************************************/ mod_mult(a,b,c) unsigned long a,b,c; { unsigned long d[2],t1,t2; unsigned long d1[2]; if (a < 32768 && b < 32768) return((a*b) % c); t1 = (unsigned long) (((double)a/(double)c)*(double)b); mul4(t1,c,d); mul4(a,b,d1); t2 = d1[0] - d[0]; /* if (t2 >= c) t2 += c; */ return(t2); }