OSDN Git Service

(split) LDP: Update the version to 3.53 in PO files
[linuxjm/LDP_man-pages.git] / release / man3 / pow.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\"     <mtk.manpages@gmail.com>
4 .\"
5 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" %%%LICENSE_END
26 .\"
27 .\" References consulted:
28 .\"     Linux libc source code
29 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
30 .\"     386BSD man pages
31 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
32 .\" Modified 1995-08-14 by Arnt Gulbrandsen <agulbra@troll.no>
33 .\" Modified 2002-07-27 by Walter Harms
34 .\"     (walter.harms@informatik.uni-oldenburg.de)
35 .\"*******************************************************************
36 .\"
37 .\" This file was generated with po4a. Translate the source file.
38 .\"
39 .\"*******************************************************************
40 .TH POW 3 2010\-09\-12 "" "Linux Programmer's Manual"
41 .SH 名前
42 pow, powf, powl \- 累乗関数
43 .SH 書式
44 .nf
45 \fB#include <math.h>\fP
46 .sp
47 \fBdouble pow(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP
48 .br
49 \fBfloat powf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP
50 .br
51 \fBlong double powl(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP
52 .fi
53 .sp
54 \fI\-lm\fP でリンクする。
55 .sp
56 .in -4n
57 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
58 .in
59 .sp
60 .ad l
61 \fBpowf\fP(), \fBpowl\fP():
62 .RS 4
63 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE
64 || _POSIX_C_SOURCE\ >=\ 200112L;
65 .br
66 or \fIcc\ \-std=c99\fP
67 .RE
68 .ad
69 .SH 説明
70 \fBpow\fP()  関数は \fIx\fP の \fIy\fP 乗の値を返す。
71 .SH 返り値
72 成功すると、これらの関数は \fIx\fP の \fIy\fP 乗の値を返す。
73
74 .\" The domain error is generated at least as far back as glibc 2.4
75 \fIx\fP が 0 未満の有限値で \fIy\fP が整数でない有限値の場合、領域エラー (domain error) が発生し、 NaN が返される。
76
77 .\" The range error is generated at least as far back as glibc 2.4
78 結果がオーバーフローする場合、 範囲エラー (range error) が発生し、 各関数はそれぞれ \fBHUGE_VAL\fP,
79 \fBHUGE_VALF\fP, \fBHUGE_VALL\fP を返す。返り値には数学的に正しい符号が付与される。
80
81 .\" POSIX.1 does not specify the sign of the zero,
82 .\" but http://sources.redhat.com/bugzilla/show_bug.cgi?id=2678
83 .\" points out that the zero has the wrong sign in some cases.
84 結果がアンダーフローし、その値が表現可能でない場合、 範囲エラーが発生し、 0.0 が返される。
85
86 以下で規定されていない場合で、 \fIx\fP か \fIy\fP が NaN の場合、返り値は NaN となる。
87
88 \fIx\fP が +1 の場合、 (\fIy\fP が NaN であったとしても) 返り値は 1.0 となる。
89
90 \fIy\fP が 0 の場合、 (\fIx\fP が NaN であったとしても) 返り値は 1.0 となる。
91
92 \fIx\fP が +0 (\-0) で \fIy\fP が 0 より大きな奇数の場合、返り値は +0 (\-0) となる。
93
94 \fIx\fP が 0 で、 \fIy\fP が 0 より大きく奇数でない場合、返り値は +0 となる。
95
96 \fIx\fP が \-1 で、 \fIy\fP が正の無限大か負の無限大の場合、返り値は 1.0 となる。
97
98 \fIx\fP の絶対値が 1 未満で、 \fIy\fP が負の無限大の場合、返り値は正の無限大となる。
99
100 \fIx\fP 絶対値が 1 より大きく、 \fIy\fP が負の無限大の場合、返り値は +0 となる。
101
102 \fIx\fP の絶対値が 1 未満で、 \fIy\fP が正の無限大の場合、返り値は +0 となる。
103
104 \fIx\fP の絶対値が 1 より大きく、 \fIy\fP が正の無限大の場合、返り値は正の無限大となる。
105
106 \fIx\fP が負の無限大で、 \fIy\fP が 0 より小さい奇数の場合、返り値は \-0 となる。
107
108 \fIx\fP が負の無限大で、 \fIy\fP が 0 より小さく奇数でない場合、返り値は +0 となる。
109
110 \fIx\fP が負の無限大で、 \fIy\fP が 0 より大きい奇数の場合、返り値は負の無限大となる。
111
112 \fIx\fP が負の無限大で、 \fIy\fP が 0 より大きく奇数でない場合、返り値は正の無限大となる。
113
114 \fIx\fP が正の無限大で、 \fIy\fP が 0 未満の場合、返り値は +0 となる。
115
116 \fIx\fP が正の無限大で、 \fIy\fP が 0 より大きい場合、返り値は正の無限大となる。
117
118 \fIx\fP が +0 か \-0 で、 \fIy\fP が 0 より小さい奇数の場合、 極エラー (pole error) が発生し、返り値は
119 \fBHUGE_VAL\fP, \fBHUGE_VALF\fP, \fBHUGE_VALL\fP となる。 \fIx\fP と同じ符号が付与される。
120
121 .\" The pole error is generated at least as far back as glibc 2.4
122 \fIx\fP が +0 か \-0 で、 \fIy\fP が 0 より小さく奇数でない場合、 極エラーが発生し、 返り値は \fB+\fPHUGE_VAL\fB,\fP
123 \fB+\fPHUGE_VALF\fB,\fP \fB+\fPHUGE_VALL となる。
124 .SH エラー
125 .\" FIXME . review status of this error
126 .\" longstanding bug report for glibc:
127 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=369
128 .\" For negative x, and -large and +large y, glibc 2.8 gives incorrect
129 .\" results
130 .\" pow(-0.5,-DBL_MAX)=nan
131 .\" EDOM FE_INVALID nan; fail-errno fail-except fail-result;
132 .\" FAIL (expected: range-error-overflow (ERANGE, FE_OVERFLOW); +INF)
133 .\"
134 .\" pow(-1.5,-DBL_MAX)=nan
135 .\" EDOM FE_INVALID nan; fail-errno fail-except fail-result;
136 .\" FAIL (expected: range-error-underflow (ERANGE, FE_UNDERFLOW); +0)
137 .\"
138 .\" pow(-0.5,DBL_MAX)=nan
139 .\" EDOM FE_INVALID nan; fail-errno fail-except fail-result;
140 .\" FAIL (expected: range-error-underflow (ERANGE, FE_UNDERFLOW); +0)
141 .\"
142 .\" pow(-1.5,DBL_MAX)=nan
143 .\" EDOM FE_INVALID nan; fail-errno fail-except fail-result;
144 .\" FAIL (expected: range-error-overflow (ERANGE, FE_OVERFLOW); +INF)
145 これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7)  を参照のこと。
146 .PP
147 以下のエラーが発生する可能性がある。
148 .TP 
149 領域エラー: \fIx\fP が負で、\fIy\fP が整数でない有限値
150 \fIerrno\fP に \fBEDOM\fP が設定される。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP)  が上がる。
151 .TP 
152 極エラー: \fIx\fP がゼロで、\fIy\fP が負
153 \fIerrno\fP に \fBERANGE\fP が設定される (「バグ」の節も参照)。 0 による除算 (divide\-by\-zero) 浮動小数点例外
154 (\fBFE_DIVBYZERO\fP)  が上がる。
155 .TP 
156 範囲エラー: 結果がオーバーフロー
157 \fIerrno\fP に \fBERANGE\fP が設定される。 オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP)  が上がる。
158 .TP 
159 範囲エラー: 結果がアンダーフロー
160 \fIerrno\fP に \fBERANGE\fP が設定される。 アンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP)  が上がる。
161 .SH 準拠
162 C99, POSIX.1\-2001.  \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。
163 .SH バグ
164 .\"
165 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776
166 .\" or possibly 2.9, I haven't found the source code change
167 .\" and I don't have a 2.9 system to test
168 glibc 2.9 とそれ以前のバージョンでは、 極エラーが発生した場合、POSIX で要求されている \fBERANGE\fP ではなく \fBEDOM\fP が
169 \fIerrno\fP に設定される。 バージョン 2.10 以降の glibc では、正しい動作をする。
170
171 .\" see bug http://sources.redhat.com/bugzilla/show_bug.cgi?id=3866
172 .\" and http://sources.redhat.com/bugzilla/show_bug.cgi?id=369
173 \fIx\fP が負の場合、大きな正負の値の \fIy\fP が与えられると、関数の結果が NaN となり、 \fIerrno\fP に \fBEDOM\fP が設定され、
174 不正浮動小数点例外 (\fBFE_INVALID\fP)  が発生する。 例えば、 \fBpow\fP()  では、 \fIy\fP の絶対値が約 9.223373e18
175 より大きい場合にこの状況となる。
176
177 .\" FIXME . Actually, 2.3.2 is the earliest test result I have; so yet
178 .\" to confirm if this error occurs only in 2.3.2.
179 glibc バージョン 2.3.2 以前では、 アンダーフローやアンダーフローのエラーが発生する場合、 glibc の \fBpow\fP()
180 は、オーバーフロー例外やアンダーフロー例外を上げるだけでなく、 不正浮動小数点例外 (\fBFE_INVALID\fP)  を間違って発生する。
181 .SH 関連項目
182 \fBcbrt\fP(3), \fBcpow\fP(3), \fBsqrt\fP(3)
183 .SH この文書について
184 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
185 である。プロジェクトの説明とバグ報告に関する情報は
186 http://www.kernel.org/doc/man\-pages/ に書かれている。