gammaのヘルプ・マニュアル
日本語 英語
gamma --help
man gamma
GAMMA(3) Linux Programmer’s Manual GAMMA(3)
名前
gamma, gammaf, gammal - ガンマ関数 (の自然対数)
書式
#include
double gamma(double x);
float gammaf(float x);
long double gammal(long double x);
-lm でリンクする。
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
gamma(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
gammaf(), gammal(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600
説明
これらの関数は非推奨である。その代わり、場面に 応 じ て tgamma(3) か
lgamma(3) を使うこと。
ガンマ関数の定義については、 tgamma(3) を参照のこと。
*BSD版
4.4BSD の libm と FreeBSD のいくつかのバージョンには、関数 gamma() が含
まれており、期待通りガンマ関数を計算できる。
glibc版
Glibcは、関数 gamma() を含んでいるが、これは lgamma(3) と等価であり、ガ
ンマ関数の自然対数を計算する。
返り値
lgamma(3) を参照。
エラー
lgamma(3) を参照。
準拠
シ ステムによって振舞いが異なるという歴史的な経緯のため、この関数はどの
標準規格でも規定されていない。
注意
歴史
4.2BSDにおいては、関数 gamma() が実際に計算するのは ln(|Gamma(|x|)|) で
あり、 Gamma(|x|) の符号が extern int signgam に格納されていた。 4.3BSD
になって関数名が変更され、 lgamma(3) となり、そのマニュアルページでは
「いつの日か gamma の名は復活し、ガンマ関数に冠されるであろう」
という誓いが述べられていた。これは4.4BSDになって実現され、 gamma() はま
さ にガンマ関数を計算するようになった。 (もう signgam には作用しない。)
ところが、これが登場する時期が遅すぎたため、 tgamma(3) という「本当のガ
ンマ関数」がすでに存在しているのである。
関連項目
lgamma(3), signgam(3), tgamma(3)
GNU 2008-08-05 GAMMA(3)
GAMMA(3) Linux Programmer’s Manual GAMMA(3)
NAME
gamma, gammaf, gammal - (logarithm of the) gamma function
SYNOPSIS
#include
double gamma(double x);
float gammaf(float x);
long double gammal(long double x);
Link with -lm.
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
gamma(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
gammaf(), gammal(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600
DESCRIPTION
These functions are deprecated: instead, use either the tgamma(3) or
the lgamma(3) functions, as appropriate.
For the definition of the Gamma function, see tgamma(3).
*BSD version
The libm in 4.4BSD and some versions of FreeBSD had a gamma() function
that computes the Gamma function, as one would expect.
glibc version
Glibc has a gamma() function that is equivalent to lgamma(3) and com-
putes the natural logarithm of the Gamma function.
RETURN VALUE
See lgamma(3).
ERRORS
See lgamma(3).
CONFORMING TO
Because of historical variations in behavior across systems, this func-
tion is not specified in any standard.
NOTES
History
4.2BSD had a gamma() that computed ln(|Gamma(|x|)|), leaving the sign
of Gamma(|x|) in the external integer signgam. In 4.3BSD the name was
changed to lgamma(3), and the man page promises
"At some time in the future the name gamma will be rehabilitated
and used for the Gamma function"
This did indeed happen in 4.4BSD, where gamma() computes the Gamma
function (with no effect on signgam). However, this came too late, and
we now have tgamma(3), the "true gamma" function.
SEE ALSO
lgamma(3), signgam(3), tgamma(3)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2008-08-05 GAMMA(3)