.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) .\" Distributed under GPL .\" based on glibc infopages .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk .\" .\" .\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI .\" all rights reserved. .\" Translated Sun Sep 22 08:44:32 2002 .\" by Akihiro MOTOKI .\" Updated & Modified Sat Feb 12 12:40:00 2005 .\" by SAITOH Akira .\" Updated 2008-09-18, Akihiro MOTOKI .\" .TH LGAMMA 3 2008-08-05 "" "Linux Programmer's Manual" .\"O .SH NAME .\"O lgamma, lgammaf, lgammal, lgamma_r, lgammaf_r, lgammal_r, signgam \- .\"O log gamma function .SH 名前 lgamma, lgammaf, lgammal, lgamma_r, lgammaf_r, lgammal_r, signgam \- ガンマ関数の対数を計算する .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "double lgamma(double " x ); .br .BI "float lgammaf(float " x ); .br .BI "long double lgammal(long double " x ); .sp .BI "double lgamma_r(double " x ", int *" signp ); .br .BI "float lgammaf_r(float " x ", int *" signp ); .br .BI "long double lgammal_r(long double " x ", int *" signp ); .sp .BI "extern int " signgam ; .fi .sp .\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .ad l .BR lgamma (): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or .I cc\ -std=c99 .br .BR lgammaf (), .BR lgammal (): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or .I cc\ -std=c99 .br .BR lgamma_r (), .BR lgammaf_r (), .BR lgammal_r (): _BSD_SOURCE || _SVID_SOURCE .br .IR signgam : _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE .ad b .\"O .SH DESCRIPTION .\"O For the definition of the Gamma function, see .\"O .BR tgamma (3). .\"O .PP .SH 説明 ガンマ関数の定義については、 .BR tgamma (3) を参照のこと。 .PP .\"O The .\"O .BR lgamma () .\"O function returns the natural logarithm of .\"O the absolute value of the Gamma function. .\"O The sign of the Gamma function is returned in the .\"O external integer \fIsigngam\fP declared in .\"O .IR . .\"O It is 1 when the Gamma function is positive or zero, \-1 .\"O when it is negative. .\"O .PP 関数 .BR lgamma () は、ガンマ関数の絶対値の自然対数を返す。 ガンマ関数の符号は、 .I で宣言されている extern int \fIsigngam\fP に格納される。 格納される値は、ガンマ関数が正または 0 の場合 1、 負の場合 \-1 である。 .PP .\"O Since using a constant location .\"O .I signgam .\"O is not thread-safe, the functions .\"O .BR lgamma_r () .\"O etc. have .\"O been introduced; they return the sign via the argument .\"O .IR signp . .I signgam という固定された場所を使うことはスレッドセーフではないので、 関数 .BR lgamma_r () などが導入されている。 これらの関数では、符号は引き数 .I signp 経由で返される。 .\"O .SH RETURN VALUE .SH 返り値 .\"O On success, these functions return the natural logarithm of Gamma(x). 成功すると、これらの関数は Gamma(x) の自然対数を返す。 .\"O If .\"O .I x .\"O is a NaN, a NaN is returned. .I x が NaN の場合、NaN が返される。 .\"O If .\"O .I x .\"O is 1 or 2, +0 is returned. .I x が 1 か 2 の場合、+0 が返される。 .\"O If .\"O .I x .\"O is positive infinity or negative infinity, .\"O positive infinity is returned. .I x が正の無限大か負の無限大の場合、 正の無限大が返される。 .\"O If .\"O .I x .\"O is a nonpositive integer, .\"O a pole error occurs, .\"O and the functions return .\"O .RB + HUGE_VAL , .\"O .RB + HUGE_VALF , .\"O or .\"O .RB + HUGE_VALL , .\"O respectively. .I x が正でない整数の場合、極エラー (pole error) が発生し、 各関数はそれぞれ .RB + HUGE_VAL , .RB + HUGE_VALF , .RB + HUGE_VALL を返す。 .\"O If the result overflows, .\"O a range error occurs, .\" e.g., lgamma(DBL_MAX) .\"O and the functions return .\"O .BR HUGE_VAL , .\"O .BR HUGE_VALF , .\"O or .\"O .BR HUGE_VALL , .\"O respectively, with the correct mathematical sign. 結果がオーバーフローする場合、範囲エラーが発生し、 各関数はそれぞれ .BR HUGE_VAL , .BR HUGE_VALF , .B HUGE_VALL を返す。返り値には数学的に正しい符号が付与される。 .\"O .SH ERRORS .SH エラー .\"O See .\"O .BR math_error (7) .\"O for information on how to determine whether an error has occurred .\"O when calling these functions. これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は .BR math_error (7) を参照のこと。 .PP .\"O The following errors can occur: 以下のエラーが発生する可能性がある。 .TP .\"O Pole error: \fIx\fP is a nonpositive integer 極エラー: \fIx\fP が正でない整数 .\"O .I errno .\"O is set to .\" FIXME . glibc 2.8 gives EDOM! .\"O .BR ERANGE .\"O (but see BUGS). .\"O A divide-by-zero floating-point exception .\"O .RB ( FE_DIVBYZERO ) .\"O is raised. .I errno に .B ERANGE が設定される (「バグ」の節を参照)。 0 による除算 (divide-by-zero) 浮動小数点例外 .RB ( FE_DIVBYZERO ) が上がる。 .TP .\"O Range error: result overflow 範囲エラー: 結果のオーバーフロー .\"O .I errno .\"O is set to .\"O .BR ERANGE . .\"O An overflow floating-point exception .\"O .RB ( FE_OVERFLOW ) .\"O is raised. .I errno に .B ERANGE が設定される。 オーバーフロー浮動小数点例外 .RB ( FE_OVERFLOW ) が上がる。 .\" glibc (as at 2.8) also supports an inexact .\" exception for various cases. .\"O .SH "CONFORMING TO" .SH 準拠 .\"O The .\"O .BR lgamma () .\"O functions are specified in C99 and POSIX.1-2001. .\"O .I signgam .\"O is specified in POSIX.1-2001, but not in C99. .\"O The .\"O .BR lgamma_r () .\"O functions are nonstandard, but present on several other systems. 関数 .BR lgamma () は C99 と POSIX.1-2001 で規定されている。 .I signgam は POSIX.1-2001 で規定されているが、C99 にはない。 関数 .BR lgamma_r () は非標準だが、いくつかの他のシステムにも存在する。 .\"O .SH BUGS .SH バグ .\"O For a pole error, 極エラーの場合、 .\" .\" FIXME . this is as at glibc 2.8; check later if this bug is fixed .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6777 .\"O .I errno .\"O is set to .\"O .BR EDOM ; .I errno に .B EDOM が設定される。 .\"O POSIX.1 says it should be set to .\"O .BR ERANGE . POSIX.1 では、 .B ERANGE が設定されるべきとされている。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR tgamma (3)