Category : C Source Code
Archive   : RECIPEX.ZIP
Filename : FACTRL.C

 
Output of file : FACTRL.C contained in archive : RECIPEX.ZIP
#include

float factrl(n)
int n;
{
static int ntop=4;
static float a[33]={1.0,1.0,2.0,6.0,24.0};
int j;
float gammln();
void nrerror();

if (n < 0) nrerror("Negative factorial in routine FACTRL");
if (n > 32) return exp(gammln(n+1.0));
while (ntop j=ntop++;
a[ntop]=a[j]*ntop;
}
return a[n];
}


  3 Responses to “Category : C Source Code
Archive   : RECIPEX.ZIP
Filename : FACTRL.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/