Last change
on this file since 305 was
305,
checked in by vondreele, 12 years ago
|
remove pypowder & powsubs - no longer needed
add texturesubs & pytexture
|
File size:
1018 bytes
|
Line | |
---|
1 | FUNCTION FACTLN(N) |
---|
2 | |
---|
3 | !PURPOSE: Compute ln(factorial) - adapted from Numerical Recipes |
---|
4 | |
---|
5 | INCLUDE '../INCLDS/COPYRIGT.FOR' |
---|
6 | |
---|
7 | !CALLING ARGUMENTS: |
---|
8 | |
---|
9 | INTEGER*4 N !Order of factorial |
---|
10 | REAL*8 FACTLN !ln(N!) returned |
---|
11 | |
---|
12 | !INCLUDE STATEMENTS: |
---|
13 | |
---|
14 | !LOCAL VARIABLES: |
---|
15 | |
---|
16 | REAL*8 A(100) |
---|
17 | INTEGER*4 IA(100) |
---|
18 | |
---|
19 | !FUNCTION DEFINITIONS: |
---|
20 | |
---|
21 | REAL*8 DGAMMLN |
---|
22 | |
---|
23 | !DATA STATEMENTS: |
---|
24 | |
---|
25 | DATA A/100*-1.0D0/,IA/100*0/ |
---|
26 | |
---|
27 | !CODE: |
---|
28 | |
---|
29 | IF ( N.LE.99 ) THEN |
---|
30 | IF ( IA(N+1).EQ.0 ) THEN |
---|
31 | IA(N+1) = 1 |
---|
32 | A(N+1) = DGAMMLN(N+1.0) |
---|
33 | END IF |
---|
34 | FACTLN = A(N+1) |
---|
35 | ELSE |
---|
36 | FACTLN = DGAMMLN(N+1.0) |
---|
37 | END IF |
---|
38 | RETURN |
---|
39 | END |
---|
40 | |
---|
Note: See
TracBrowser
for help on using the repository browser.