factln.c
来自「Numerical Recipes Software 提供的算法子程序集」· C语言 代码 · 共 14 行
C
14 行
float factln(n)
int n;
{
float gammln();
void nrerror();
static float a[101];
if (n < 0) nrerror("Negative factorial in routine factln");
if (n <= 1) return 0.0;
if (n <= 100) return a[n] ? a[n] : (a[n]=gammln(n+1.0));
else return gammln(n+1.0);
}
/* (C) Copr. 1986-92 Numerical Recipes Software . */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?