.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) .\" .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE) .\" Distributed under GPL .\" %%%LICENSE_END .\" .\" Modified 2003-11-18, aeb: historical remarks .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI .\" all rights reserved. .\" historical remarks: Japanese Version Copyright (c) 2005 SAITOH Akira .\" all rights reserved. .\" Translated Sun Sep 22 08:34:42 2002 .\" by Akihiro MOTOKI .\" Updated & Modified Sat Feb 19 05:50:00 2005 .\" by SAITOH Akira .\" Updated 2008-09-16, Akihiro MOTOKI .\" .TH GAMMA 3 2008\-08\-05 GNU "Linux Programmer's Manual" .SH 名前 gamma, gammaf, gammal \- ガンマ関数 (の自然対数) .SH 書式 \fB#include \fP .sp \fBdouble gamma(double \fP\fIx\fP\fB);\fP .br \fBfloat gammaf(float \fP\fIx\fP\fB);\fP .br \fBlong double gammal(long double \fP\fIx\fP\fB);\fP .sp \fI\-lm\fP でリンクする。 .sp .in -4n glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l \fBgamma\fP(): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE .RE \fBgammaf\fP(), \fBgammal\fP(): .RS 4 .\" Also seems to work: -std=c99 -D_XOPEN_SOURCE _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 .RE .ad b .SH 説明 これらの関数は非推奨である。その代わり、場面に応じて \fBtgamma\fP(3) か \fBlgamma\fP(3) を使うこと。 ガンマ関数の定義については、 \fBtgamma\fP(3) を参照のこと。 .SS *BSD版 4.4BSD の libm と FreeBSD のいくつかのバージョンには、関数 \fBgamma\fP() が含まれており、期待通りガンマ関数を計算できる。 .SS glibc版 Glibcは、関数 \fBgamma\fP() を含んでいるが、これは \fBlgamma\fP(3) と等価であり、ガンマ関数の自然対数を計算する。 .SH 返り値 \fBlgamma\fP(3) を参照。 .SH エラー \fBlgamma\fP(3) を参照。 .SH 準拠 システムによって振舞いが異なるという歴史的な経緯のため、 この関数はどの標準規格でも規定されていない。 .SH 注意 .SS 歴史 4.2BSDにおいては、関数 \fBgamma\fP() が実際に計算するのは ln(|Gamma(|\fIx\fP|)|) であり、 Gamma(|\fIx\fP|) の符号が extern int \fIsigngam\fP に格納されていた。 4.3BSDになって関数名が変更され、 \fBlgamma\fP(3) となり、そのマニュアルページでは .sp .in +4n "「いつの日か gamma の名は復活し、ガンマ関数に冠されるであろう」" .in .sp .\" The FreeBSD man page says about gamma() that it is like lgamma() .\" except that is does not set signgam. .\" Also, that 4.4BSD has a gamma() that computes the true gamma function. という誓いが述べられていた。 これは4.4BSDになって実現され、 \fBgamma\fP() はまさにガンマ関数を計算するようになった。 (もう \fIsigngam\fP には作用しない。) ところが、これが登場する時期が遅すぎたため、 \fBtgamma\fP(3) という「本当のガンマ関数」がすでに存在しているのである。 .SH 関連項目 \fBlgamma\fP(3), \fBsigngam\fP(3), \fBtgamma\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。