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 2008-08-05 "" "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)
55 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or
60 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
66 _BSD_SOURCE || _SVID_SOURCE
69 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
72 .\"O For the definition of the Gamma function, see
76 ¥¬¥ó¥Þ´Ø¿ô¤ÎÄêµÁ¤Ë¤Ä¤¤¤Æ¤Ï¡¢
82 .\"O function returns the natural logarithm of
83 .\"O the absolute value of the Gamma function.
84 .\"O The sign of the Gamma function is returned in the
85 .\"O external integer \fIsigngam\fP declared in
87 .\"O It is 1 when the Gamma function is positive or zero, \-1
88 .\"O when it is negative.
92 ¤Ï¡¢¥¬¥ó¥Þ´Ø¿ô¤ÎÀäÂÐÃͤμ«Á³Âпô¤òÊÖ¤¹¡£
95 ¤ÇÀë¸À¤µ¤ì¤Æ¤¤¤ë extern int \fIsigngam\fP ¤Ë³ÊǼ¤µ¤ì¤ë¡£
96 ³ÊǼ¤µ¤ì¤ëÃͤϡ¢¥¬¥ó¥Þ´Ø¿ô¤¬Àµ¤Þ¤¿¤Ï 0 ¤Î¾ì¹ç 1¡¢
99 .\"O Since using a constant location
101 .\"O is not thread-safe, the functions
104 .\"O been introduced; they return the sign via the argument
107 ¤È¤¤¤¦¸ÇÄꤵ¤ì¤¿¾ì½ê¤ò»È¤¦¤³¤È¤Ï¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢
110 ¤Ê¤É¤¬Æ³Æþ¤µ¤ì¤Æ¤¤¤ë¡£
111 ¤³¤ì¤é¤Î´Ø¿ô¤Ç¤Ï¡¢Éä¹æ¤Ï°ú¤¿ô
114 .\"O .SH RETURN VALUE
116 .\"O On success, these functions return the natural logarithm of Gamma(x).
117 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï Gamma(x) ¤Î¼«Á³Âпô¤òÊÖ¤¹¡£
121 .\"O is a NaN, a NaN is returned.
123 ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
127 .\"O is 1 or 2, +0 is returned.
129 ¤¬ 1 ¤« 2 ¤Î¾ì¹ç¡¢+0 ¤¬ÊÖ¤µ¤ì¤ë¡£
133 .\"O is positive infinity or negative infinity,
134 .\"O positive infinity is returned.
136 ¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢
137 Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£
141 .\"O is a nonpositive integer,
142 .\"O a pole error occurs,
143 .\"O and the functions return
144 .\"O .RB + HUGE_VAL ,
145 .\"O .RB + HUGE_VALF ,
147 .\"O .RB + HUGE_VALL ,
150 ¤¬Àµ¤Ç¤Ê¤¤À°¿ô¤Î¾ì¹ç¡¢¶Ë¥¨¥é¡¼ (pole error) ¤¬È¯À¸¤·¡¢
157 .\"O If the result overflows,
158 .\"O a range error occurs,
159 .\" e.g., lgamma(DBL_MAX)
160 .\"O and the functions return
165 .\"O respectively, with the correct mathematical sign.
166 ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢
171 ¤òÊÖ¤¹¡£ÊÖ¤êÃͤˤϿô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£
175 .\"O .BR math_error (7)
176 .\"O for information on how to determine whether an error has occurred
177 .\"O when calling these functions.
178 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
182 .\"O The following errors can occur:
183 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ¤¬¤¢¤ë¡£
185 .\"O Pole error: \fIx\fP is a nonpositive integer
186 ¶Ë¥¨¥é¡¼: \fIx\fP ¤¬Àµ¤Ç¤Ê¤¤À°¿ô
189 .\" FIXME . glibc 2.8 gives EDOM!
192 .\"O A divide-by-zero floating-point exception
193 .\"O .RB ( FE_DIVBYZERO )
198 ¤¬ÀßÄꤵ¤ì¤ë (¡Ö¥Ð¥°¡×¤ÎÀá¤ò»²¾È)¡£
199 0 ¤Ë¤è¤ë½ü»» (divide-by-zero) ÉâÆ°¾®¿ôÅÀÎã³°
203 .\"O Range error: result overflow
204 ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼
208 .\"O An overflow floating-point exception
209 .\"O .RB ( FE_OVERFLOW )
215 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
218 .\" glibc (as at 2.8) also supports an inexact
219 .\" exception for various cases.
220 .\"O .SH "CONFORMING TO"
224 .\"O functions are specified in C99 and POSIX.1-2001.
226 .\"O is specified in POSIX.1-2001, but not in C99.
229 .\"O functions are nonstandard, but present on several other systems.
232 ¤Ï C99 ¤È POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¡£
234 ¤Ï POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤ë¤¬¡¢C99 ¤Ë¤Ï¤Ê¤¤¡£
237 ¤ÏÈóɸ½à¤À¤¬¡¢¤¤¤¯¤Ä¤«¤Î¾¤Î¥·¥¹¥Æ¥à¤Ë¤â¸ºß¤¹¤ë¡£
240 .\"O For a pole error,
243 .\" FIXME . this is as at glibc 2.8; check later if this bug is fixed
244 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6777
252 .\"O POSIX.1 says it should be set to
256 ¤¬ÀßÄꤵ¤ì¤ë¤Ù¤¤È¤µ¤ì¤Æ¤¤¤ë¡£