OSDN Git Service

Apply minor changes from v3.32 to v3.35 in the upstream.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / lgamma.3
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
3 .\" based on glibc infopages
4 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
5 .\"     <mtk.manpages@gmail.com>
6 .\"
7 .\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI
8 .\"         all rights reserved.
9 .\" Translated Sun Sep 22 08:44:32 2002
10 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
11 .\" Updated & Modified Sat Feb 12 12:40:00 2005
12 .\"         by SAITOH Akira <s-akira@users.sourceforge.net>
13 .\" Updated 2008-09-18, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
14 .\"
15 .TH LGAMMA 3 2010-09-11 "" "Linux Programmer's Manual"
16 .\"O .SH NAME
17 .\"O lgamma, lgammaf, lgammal, lgamma_r, lgammaf_r, lgammal_r, signgam \-
18 .\"O log gamma function
19 .SH Ì¾Á°
20 lgamma, lgammaf, lgammal, lgamma_r, lgammaf_r, lgammal_r, signgam \-
21 ¥¬¥ó¥Þ´Ø¿ô¤ÎÂпô¤ò·×»»¤¹¤ë
22 .\"O .SH SYNOPSIS
23 .SH ½ñ¼°
24 .nf
25 .B #include <math.h>
26 .sp
27 .BI "double lgamma(double " x );
28 .br
29 .BI "float lgammaf(float " x );
30 .br
31 .BI "long double lgammal(long double " x );
32 .sp
33 .BI "double lgamma_r(double " x ", int *" signp );
34 .br
35 .BI "float lgammaf_r(float " x ", int *" signp );
36 .br
37 .BI "long double lgammal_r(long double " x ", int *" signp );
38 .sp
39 .BI "extern int " signgam ;
40 .fi
41 .sp
42 .\"O Link with \fI\-lm\fP.
43 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
44 .sp
45 .in -4n
46 .\"O Feature Test Macro Requirements for glibc (see
47 .\"O .BR feature_test_macros (7)):
48 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
49 .RB ( feature_test_macros (7)
50 »²¾È):
51 .in
52 .sp
53 .ad l
54 .BR lgamma ():
55 .RS 4
56 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE ||
57 _POSIX_C_SOURCE\ >=\ 200112L;
58 .br
59 or
60 .I cc\ -std=c99
61 .RE
62 .br
63 .BR lgammaf (),
64 .BR lgammal ():
65 .RS 4
66 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
67 _POSIX_C_SOURCE\ >=\ 200112L;
68 .br
69 or
70 .I cc\ -std=c99
71 .RE
72 .BR lgamma_r (),
73 .BR lgammaf_r (),
74 .BR lgammal_r ():
75 .RS 4
76 _BSD_SOURCE || _SVID_SOURCE
77 .RE
78 .IR signgam :
79 .RS 4
80 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
81 .RE
82 .ad b
83 .\"O .SH DESCRIPTION
84 .\"O For the definition of the Gamma function, see
85 .\"O .BR tgamma (3).
86 .\"O .PP
87 .SH ÀâÌÀ
88 ¥¬¥ó¥Þ´Ø¿ô¤ÎÄêµÁ¤Ë¤Ä¤¤¤Æ¤Ï¡¢
89 .BR tgamma (3)
90 ¤ò»²¾È¤Î¤³¤È¡£
91 .PP
92 .\"O The
93 .\"O .BR lgamma ()
94 .\"O function returns the natural logarithm of
95 .\"O the absolute value of the Gamma function.
96 .\"O The sign of the Gamma function is returned in the
97 .\"O external integer \fIsigngam\fP declared in
98 .\"O .IR <math.h> .
99 .\"O It is 1 when the Gamma function is positive or zero, \-1
100 .\"O when it is negative.
101 .\"O .PP
102 ´Ø¿ô
103 .BR lgamma ()
104 ¤Ï¡¢¥¬¥ó¥Þ´Ø¿ô¤ÎÀäÂÐÃͤμ«Á³Âпô¤òÊÖ¤¹¡£
105 ¥¬¥ó¥Þ´Ø¿ô¤ÎÉä¹æ¤Ï¡¢
106 .I <math.h>
107 ¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤ë extern int \fIsigngam\fP ¤Ë³ÊǼ¤µ¤ì¤ë¡£
108 ³ÊǼ¤µ¤ì¤ëÃͤϡ¢¥¬¥ó¥Þ´Ø¿ô¤¬Àµ¤Þ¤¿¤Ï 0 ¤Î¾ì¹ç 1¡¢
109 Éé¤Î¾ì¹ç \-1 ¤Ç¤¢¤ë¡£
110 .PP
111 .\"O Since using a constant location
112 .\"O .I signgam
113 .\"O is not thread-safe, the functions
114 .\"O .BR lgamma_r ()
115 .\"O etc. have
116 .\"O been introduced; they return the sign via the argument
117 .\"O .IR signp .
118 .I signgam
119 ¤È¤¤¤¦¸ÇÄꤵ¤ì¤¿¾ì½ê¤ò»È¤¦¤³¤È¤Ï¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢
120 ´Ø¿ô
121 .BR lgamma_r ()
122 ¤Ê¤É¤¬Æ³Æþ¤µ¤ì¤Æ¤¤¤ë¡£
123 ¤³¤ì¤é¤Î´Ø¿ô¤Ç¤Ï¡¢Éä¹æ¤Ï°ú¤­¿ô
124 .I signp
125 ·Ðͳ¤ÇÊÖ¤µ¤ì¤ë¡£
126 .\"O .SH RETURN VALUE
127 .SH ÊÖ¤êÃÍ
128 .\"O On success, these functions return the natural logarithm of Gamma(x).
129 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï Gamma(x) ¤Î¼«Á³Âпô¤òÊÖ¤¹¡£
130
131 .\"O If
132 .\"O .I x
133 .\"O is a NaN, a NaN is returned.
134 .I x
135 ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
136
137 .\"O If
138 .\"O .I x
139 .\"O is 1 or 2, +0 is returned.
140 .I x
141 ¤¬ 1 ¤« 2 ¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£
142
143 .\"O If
144 .\"O .I x
145 .\"O is positive infinity or negative infinity,
146 .\"O positive infinity is returned.
147 .I x
148 ¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢
149 Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£
150
151 .\"O If
152 .\"O .I x
153 .\"O is a nonpositive integer,
154 .\"O a pole error occurs,
155 .\"O and the functions return
156 .\"O .RB + HUGE_VAL ,
157 .\"O .RB + HUGE_VALF ,
158 .\"O or
159 .\"O .RB + HUGE_VALL ,
160 .\"O respectively.
161 .I x
162 ¤¬Àµ¤Ç¤Ê¤¤À°¿ô¤Î¾ì¹ç¡¢¶Ë¥¨¥é¡¼ (pole error) ¤¬È¯À¸¤·¡¢
163 ³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì
164 .RB + HUGE_VAL ,
165 .RB + HUGE_VALF ,
166 .RB + HUGE_VALL
167 ¤òÊÖ¤¹¡£
168
169 .\"O If the result overflows,
170 .\"O a range error occurs,
171 .\" e.g., lgamma(DBL_MAX)
172 .\"O and the functions return
173 .\"O .BR HUGE_VAL ,
174 .\"O .BR HUGE_VALF ,
175 .\"O or
176 .\"O .BR HUGE_VALL ,
177 .\"O respectively, with the correct mathematical sign.
178 ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢
179 ³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì
180 .BR HUGE_VAL ,
181 .BR HUGE_VALF ,
182 .B HUGE_VALL
183 ¤òÊÖ¤¹¡£ÊÖ¤êÃͤˤϿô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£
184 .\"O .SH ERRORS
185 .SH ¥¨¥é¡¼
186 .\"O See
187 .\"O .BR math_error (7)
188 .\"O for information on how to determine whether an error has occurred
189 .\"O when calling these functions.
190 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
191 .BR math_error (7)
192 ¤ò»²¾È¤Î¤³¤È¡£
193 .PP
194 .\"O The following errors can occur:
195 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
196 .TP
197 .\"O Pole error: \fIx\fP is a nonpositive integer
198 ¶Ë¥¨¥é¡¼: \fIx\fP ¤¬Àµ¤Ç¤Ê¤¤À°¿ô
199 .\"O .I errno
200 .\"O is set to
201 .\"O .BR ERANGE
202 .\"O (but see BUGS).
203 .\"O A divide-by-zero floating-point exception
204 .\"O .RB ( FE_DIVBYZERO )
205 .\"O is raised.
206 .I errno
207 ¤Ë
208 .B ERANGE
209 ¤¬ÀßÄꤵ¤ì¤ë (¡Ö¥Ð¥°¡×¤ÎÀá¤ò»²¾È)¡£
210 0 ¤Ë¤è¤ë½ü»» (divide-by-zero) ÉâÆ°¾®¿ôÅÀÎã³°
211 .RB ( FE_DIVBYZERO )
212 ¤¬¾å¤¬¤ë¡£
213 .TP
214 .\"O Range error: result overflow
215 ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼
216 .\"O .I errno
217 .\"O is set to
218 .\"O .BR ERANGE .
219 .\"O An overflow floating-point exception
220 .\"O .RB ( FE_OVERFLOW )
221 .\"O is raised.
222 .I errno
223 ¤Ë
224 .B ERANGE
225 ¤¬ÀßÄꤵ¤ì¤ë¡£
226 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
227 .RB ( FE_OVERFLOW )
228 ¤¬¾å¤¬¤ë¡£
229 .\" glibc (as at 2.8) also supports an inexact
230 .\" exception for various cases.
231 .\"O .SH "CONFORMING TO"
232 .SH ½àµò
233 .\"O The
234 .\"O .BR lgamma ()
235 .\"O functions are specified in C99 and POSIX.1-2001.
236 .\"O .I signgam
237 .\"O is specified in POSIX.1-2001, but not in C99.
238 .\"O The
239 .\"O .BR lgamma_r ()
240 .\"O functions are nonstandard, but present on several other systems.
241 ´Ø¿ô
242 .BR lgamma ()
243 ¤Ï C99 ¤È POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
244 .I signgam
245 ¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¤¬¡¢C99 ¤Ë¤Ï¤Ê¤¤¡£
246 ´Ø¿ô
247 .BR lgamma_r ()
248 ¤ÏÈóɸ½à¤À¤¬¡¢¤¤¤¯¤Ä¤«¤Î¾¤Î¥·¥¹¥Æ¥à¤Ë¤â¸ºß¤¹¤ë¡£
249 .\"O .SH BUGS
250 .SH ¥Ð¥°
251 .\"O In glibc 2.9 and earlier,
252 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6777
253 .\"O when a pole error occurs,
254 .\"O .I errno
255 .\"O is set to
256 .\"O .BR EDOM ;
257 .\"O instead of the POSIX-mandated
258 .\"O .BR ERANGE .
259 .\"O Since version 2.10, glibc does the right thing.
260 glibc 2.9 ¤È¤½¤ì°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢
261 ¶Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¡¢POSIX ¤ÇÍ׵ᤵ¤ì¤Æ¤¤¤ë
262 .B ERANGE
263 ¤Ç¤Ï¤Ê¤¯
264 .B EDOM
265 ¤¬
266 .I errno
267 ¤ËÀßÄꤵ¤ì¤ë¡£
268 POSIX.1 ¤Ç¤Ï¡¢
269 .B ERANGE
270 ¤¬ÀßÄꤵ¤ì¤ë¤Ù¤­¤È¤µ¤ì¤Æ¤¤¤ë¡£
271 ¥Ð¡¼¥¸¥ç¥ó 2.10 °Ê¹ß¤Î glibc ¤Ç¤Ï¡¢Àµ¤·¤¤Æ°ºî¤ò¤¹¤ë¡£
272 .\"O .SH "SEE ALSO"
273 .SH ´ØÏ¢¹àÌÜ
274 .BR tgamma (3)