相关代码 |
|
Function GAMMLN(XX:real):real; const STP=2.50662827465; HALF=0.5; ONE=1.0; FPF=5.5; var X,TMP,SER:double; J:integer; COF:array[1..6] of double; begin COF[1]:=76.18009173; COF[2]:=-86.50532033; COF[3]:=24.01409822; COF[4]:=-1.231739516; COF[5]:= 0.120858003e-2; COF[6]:=-0.536382e-5; X:=XX-ONE; TMP:=X+FPF; TMP:=(X+HALF)*Ln(TMP)-TMP; SER:=ONE; For J:=1 To 6 do begin X:=X+ONE; SER:=SER+COF[J]/X end; GAMMLN:=TMP+Ln(STP*SER); end;
相关资源 |
|