GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
algams.f
Go to the documentation of this file.
1 *DECK ALGAMS
2  SUBROUTINE algams (X, ALGAM, SGNGAM)
3 C***BEGIN PROLOGUE ALGAMS
4 C***PURPOSE Compute the logarithm of the absolute value of the Gamma
5 C function.
6 C***LIBRARY SLATEC (FNLIB)
7 C***CATEGORY C7A
8 C***TYPE SINGLE PRECISION (ALGAMS-S, DLGAMS-D)
9 C***KEYWORDS ABSOLUTE VALUE OF THE LOGARITHM OF THE GAMMA FUNCTION,
10 C FNLIB, SPECIAL FUNCTIONS
11 C***AUTHOR Fullerton, W., (LANL)
12 C***DESCRIPTION
13 C
14 C Evaluates the logarithm of the absolute value of the gamma
15 C function.
16 C X - input argument
17 C ALGAM - result
18 C SGNGAM - is set to the sign of GAMMA(X) and will
19 C be returned at +1.0 or -1.0.
20 C
21 C***REFERENCES (NONE)
22 C***ROUTINES CALLED ALNGAM
23 C***REVISION HISTORY (YYMMDD)
24 C 770701 DATE WRITTEN
25 C 890531 Changed all specific intrinsics to generic. (WRB)
26 C 890531 REVISION DATE from Version 3.2
27 C 891214 Prologue converted to Version 4.0 format. (BAB)
28 C***END PROLOGUE ALGAMS
29 C***FIRST EXECUTABLE STATEMENT ALGAMS
30  algam = alngam(x)
31  sgngam = 1.0
32  IF (x.GT.0.0) RETURN
33 C
34  int = mod(-aint(x), 2.0) + 0.1
35  IF (int.EQ.0) sgngam = -1.0
36 C
37  RETURN
38  END
octave_int< T > mod(const octave_int< T > &x, const octave_int< T > &y)
Definition: oct-inttypes.h:959
subroutine algams(X, ALGAM, SGNGAM)
Definition: algams.f:2
function alngam(X)
Definition: alngam.f:2