struct Factorial { static const Int NLTAB = 10000; VecDoub tab; VecDoub ltab; Factorial() : tab(171), ltab(NLTAB) { Int i; tab[0] = 1.; ltab[0] = 0.; for (i=1;i<171;i++) { tab[i] = i*tab[i-1]; ltab[i] = log(tab[i]); } for (i=171;i170) throw("factorial overflows"); return tab[i]; } Doub facln(const Int i) { if (i<0) throw("negative facln arg"); if (in) throw("bico bad args"); if (n<171) return floor(0.5+tab[n]/(tab[k]*tab[n-k])); if (n