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>
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>
15 .TH LGAMMA 3 2010-09-11 "" "Linux Programmer's Manual"
17 .\"O lgamma, lgammaf, lgammal, lgamma_r, lgammaf_r, lgammal_r, signgam \-
18 .\"O log gamma function
20 lgamma, lgammaf, lgammal, lgamma_r, lgammaf_r, lgammal_r, signgam \-
21 ¥¬¥ó¥Þ´Ø¿ô¤ÎÂпô¤ò·×»»¤¹¤ë
27 .BI "double lgamma(double " x );
29 .BI "float lgammaf(float " x );
31 .BI "long double lgammal(long double " x );
33 .BI "double lgamma_r(double " x ", int *" signp );
35 .BI "float lgammaf_r(float " x ", int *" signp );
37 .BI "long double lgammal_r(long double " x ", int *" signp );
39 .BI "extern int " signgam ;
42 .\"O Link with \fI\-lm\fP.
43 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
46 .\"O Feature Test Macro Requirements for glibc (see
47 .\"O .BR feature_test_macros (7)):
48 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
49 .RB ( feature_test_macros (7)
56 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE ||
57 _POSIX_C_SOURCE\ >=\ 200112L;
66 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
67 _POSIX_C_SOURCE\ >=\ 200112L;
76 _BSD_SOURCE || _SVID_SOURCE
80 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
84 .\"O For the definition of the Gamma function, see
88 ¥¬¥ó¥Þ´Ø¿ô¤ÎÄêµÁ¤Ë¤Ä¤¤¤Æ¤Ï¡¢
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
99 .\"O It is 1 when the Gamma function is positive or zero, \-1
100 .\"O when it is negative.
104 ¤Ï¡¢¥¬¥ó¥Þ´Ø¿ô¤ÎÀäÂÐÃͤμ«Á³Âпô¤òÊÖ¤¹¡£
107 ¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤ë extern int \fIsigngam\fP ¤Ë³ÊǼ¤µ¤ì¤ë¡£
108 ³ÊǼ¤µ¤ì¤ëÃͤϡ¢¥¬¥ó¥Þ´Ø¿ô¤¬Àµ¤Þ¤¿¤Ï 0 ¤Î¾ì¹ç 1¡¢
109 Éé¤Î¾ì¹ç \-1 ¤Ç¤¢¤ë¡£
111 .\"O Since using a constant location
113 .\"O is not thread-safe, the functions
116 .\"O been introduced; they return the sign via the argument
119 ¤È¤¤¤¦¸ÇÄꤵ¤ì¤¿¾ì½ê¤ò»È¤¦¤³¤È¤Ï¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢
122 ¤Ê¤É¤¬Æ³Æþ¤µ¤ì¤Æ¤¤¤ë¡£
123 ¤³¤ì¤é¤Î´Ø¿ô¤Ç¤Ï¡¢Éä¹æ¤Ï°ú¤¿ô
126 .\"O .SH RETURN VALUE
128 .\"O On success, these functions return the natural logarithm of Gamma(x).
129 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï Gamma(x) ¤Î¼«Á³Âпô¤òÊÖ¤¹¡£
133 .\"O is a NaN, a NaN is returned.
135 ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
139 .\"O is 1 or 2, +0 is returned.
141 ¤¬ 1 ¤« 2 ¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£
145 .\"O is positive infinity or negative infinity,
146 .\"O positive infinity is returned.
148 ¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢
149 Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£
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 ,
159 .\"O .RB + HUGE_VALL ,
162 ¤¬Àµ¤Ç¤Ê¤¤À°¿ô¤Î¾ì¹ç¡¢¶Ë¥¨¥é¡¼ (pole error) ¤¬È¯À¸¤·¡¢
169 .\"O If the result overflows,
170 .\"O a range error occurs,
171 .\" e.g., lgamma(DBL_MAX)
172 .\"O and the functions return
177 .\"O respectively, with the correct mathematical sign.
178 ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢
183 ¤òÊÖ¤¹¡£ÊÖ¤êÃͤˤϿô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£
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 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
194 .\"O The following errors can occur:
195 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ¤¬¤¢¤ë¡£
197 .\"O Pole error: \fIx\fP is a nonpositive integer
198 ¶Ë¥¨¥é¡¼: \fIx\fP ¤¬Àµ¤Ç¤Ê¤¤À°¿ô
203 .\"O A divide-by-zero floating-point exception
204 .\"O .RB ( FE_DIVBYZERO )
209 ¤¬ÀßÄꤵ¤ì¤ë (¡Ö¥Ð¥°¡×¤ÎÀá¤ò»²¾È)¡£
210 0 ¤Ë¤è¤ë½ü»» (divide-by-zero) ÉâÆ°¾®¿ôÅÀÎã³°
214 .\"O Range error: result overflow
215 ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼
219 .\"O An overflow floating-point exception
220 .\"O .RB ( FE_OVERFLOW )
226 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
229 .\" glibc (as at 2.8) also supports an inexact
230 .\" exception for various cases.
231 .\"O .SH "CONFORMING TO"
235 .\"O functions are specified in C99 and POSIX.1-2001.
237 .\"O is specified in POSIX.1-2001, but not in C99.
240 .\"O functions are nonstandard, but present on several other systems.
243 ¤Ï C99 ¤È POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
245 ¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¤¬¡¢C99 ¤Ë¤Ï¤Ê¤¤¡£
248 ¤ÏÈóɸ½à¤À¤¬¡¢¤¤¤¯¤Ä¤«¤Î¾¤Î¥·¥¹¥Æ¥à¤Ë¤â¸ºß¤¹¤ë¡£
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,
257 .\"O instead of the POSIX-mandated
259 .\"O Since version 2.10, glibc does the right thing.
260 glibc 2.9 ¤È¤½¤ì°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢
261 ¶Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¡¢POSIX ¤ÇÍ׵ᤵ¤ì¤Æ¤¤¤ë
270 ¤¬ÀßÄꤵ¤ì¤ë¤Ù¤¤È¤µ¤ì¤Æ¤¤¤ë¡£
271 ¥Ð¡¼¥¸¥ç¥ó 2.10 °Ê¹ß¤Î glibc ¤Ç¤Ï¡¢Àµ¤·¤¤Æ°ºî¤ò¤¹¤ë¡£