lgamma.3 (64890443c1b144b289df30a5123d179955bc8c92) lgamma.3 (a9dbc63dc2a2c6866b650af62ab04bc59da50d30)
1.\" Copyright (c) 1985, 1991 Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 64 unchanged lines hidden (view full) ---

73.Pp
74The external integer
75.Fa signgam
76returns the sign of \(*G(x).
77.Pp
78.Fn gamma x
79and
80.Fn gammaf x
1.\" Copyright (c) 1985, 1991 Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 64 unchanged lines hidden (view full) ---

73.Pp
74The external integer
75.Fa signgam
76returns the sign of \(*G(x).
77.Pp
78.Fn gamma x
79and
80.Fn gammaf x
81return \(*G(x), with no effect on
81return ln\||\(*G(x)|, with no effect on
82.Fa signgam .
83.Sh IDIOSYNCRASIES
84Do not use the expression
85.Dq Li signgam\(**exp(lgamma(x))
86to compute g := \(*G(x).
87Instead use a program like this (in C):
88.Bd -literal -offset indent
89lg = lgamma(x); g = signgam\(**exp(lg);
90.Ed
91.Pp
92Only after
93.Fn lgamma
94or
95.Fn lgammaf
96has returned can signgam be correct.
82.Fa signgam .
83.Sh IDIOSYNCRASIES
84Do not use the expression
85.Dq Li signgam\(**exp(lgamma(x))
86to compute g := \(*G(x).
87Instead use a program like this (in C):
88.Bd -literal -offset indent
89lg = lgamma(x); g = signgam\(**exp(lg);
90.Ed
91.Pp
92Only after
93.Fn lgamma
94or
95.Fn lgammaf
96has returned can signgam be correct.
97.Pp
98For arguments in its range,
99.Fn gamma
100and
101.Fn gammaf
102is preferred, as for positive arguments
103it is accurate to within one unit in the last place.
104Exponentiation of
105.Fn lgamma
106will lose up to 10 significant bits.
97.\.Pp
98.\For arguments in its range,
99.\.Fn gamma
100.\and
101.\.Fn gammaf
102.\is preferred, as for positive arguments
103.\it is accurate to within one unit in the last place.
104.\Exponentiation of
105.\.Fn lgamma
106.\will lose up to 10 significant bits.
107.Sh RETURN VALUES
108.Fn gamma ,
109.Fn gammaf ,
110.Fn lgamma ,
111and
112.Fn lgammaf
113return appropriate values unless an argument is out of range.
114Overflow will occur for sufficiently large positive values, and

--- 13 unchanged lines hidden (view full) ---

128.Sh HISTORY
129The
130.Fn lgamma
131function appeared in
132.Bx 4.3 .
133The
134.Fn gamma
135function appeared in
107.Sh RETURN VALUES
108.Fn gamma ,
109.Fn gammaf ,
110.Fn lgamma ,
111and
112.Fn lgammaf
113return appropriate values unless an argument is out of range.
114Overflow will occur for sufficiently large positive values, and

--- 13 unchanged lines hidden (view full) ---

128.Sh HISTORY
129The
130.Fn lgamma
131function appeared in
132.Bx 4.3 .
133The
134.Fn gamma
135function appeared in
136.Bx 4.4 .
137The name
136.Bx 4.4
137as a function which computed \(*G(x).
138In many older libraries the function
138.Fn gamma
139.Fn gamma
139was originally dedicated to the
140.Fn lgamma
141function, so some old code may no longer be compatible.
140calculated the same value as
141.Fn lgamma .
142Now
143.Fn gamma
144computes ln\||\(*G(x)|,
145but it uses a different algorithm,
146and it does not set
147.Fa signgam .
148The
149.St -isoC-99
150standard specifies a function
151.Fn tgamma
152for computing \(*G(x).
153This function is currently unimplimented in this library.