OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[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 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\"     386BSD man pages
29 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
30 .\" Modified 1995-08-14 by Arnt Gulbrandsen <agulbra@troll.no>
31 .\" Modified 2002-07-27 by Walter Harms
32 .\"     (walter.harms@informatik.uni-oldenburg.de)
33 .\"
34 .\" Japanese Version Copyright (c) 2003, 2008  Akihiro MOTOKI
35 .\"         all rights reserved.
36 .\" Translated Mon Sep  7 23:27:52 JST 2003
37 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
38 .\" Updated 2008-09-18, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
39 .\"
40 .TH POW 3  2010-09-12 "" "Linux Programmer's Manual"
41 .SH Ì¾Á°
42 pow, powf, powl \- Îß¾è´Ø¿ô
43 .SH ½ñ¼°
44 .nf
45 .B #include <math.h>
46 .sp
47 .BI "double pow(double " x ", double " y );
48 .br
49 .BI "float powf(float " x ", float " y );
50 .br
51 .BI "long double powl(long double " x ", long double " y );
52 .fi
53 .sp
54 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
55 .sp
56 .in -4n
57 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
58 .RB ( feature_test_macros (7)
59 »²¾È):
60 .in
61 .sp
62 .ad l
63 .BR powf (),
64 .BR powl ():
65 .RS 4
66 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
67 _POSIX_C_SOURCE\ >=\ 200112L;
68 .br
69 or
70 .I cc\ -std=c99
71 .RE
72 .ad
73 .SH ÀâÌÀ
74 .BR pow ()
75 ´Ø¿ô¤Ï \fIx\fP ¤Î \fIy\fP ¾è¤ÎÃͤòÊÖ¤¹¡£
76 .SH ÊÖ¤êÃÍ
77 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï
78 .I x
79 ¤Î
80 .I y
81 ¾è¤ÎÃͤòÊÖ¤¹¡£
82
83 .I x
84 ¤¬ 0 Ì¤Ëþ¤ÎÍ­¸ÂÃͤÇ
85 .I y
86 ¤¬À°¿ô¤Ç¤Ê¤¤Í­¸ÂÃͤξì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢
87 .\" The domain error is generated at least as far back as glibc 2.4
88 NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
89
90 ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢
91 ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢
92 .\" The range error is generated at least as far back as glibc 2.4
93 ³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì
94 .BR HUGE_VAL ,
95 .BR HUGE_VALF ,
96 .BR HUGE_VALL
97 ¤òÊÖ¤¹¡£ÊÖ¤êÃͤˤϿô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£
98
99 ·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤·¡¢¤½¤ÎÃͤ¬É½¸½²Äǽ¤Ç¤Ê¤¤¾ì¹ç¡¢
100 ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢ 0.0 ¤¬ÊÖ¤µ¤ì¤ë¡£
101 .\" POSIX.1 does not specify the sign of the zero,
102 .\" but http://sources.redhat.com/bugzilla/show_bug.cgi?id=2678
103 .\" points out that the zero has the wrong sign in some cases.
104
105 °Ê²¼¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¡¢
106 .I x
107 ¤«
108 .I y
109 ¤¬ NaN ¤Î¾ì¹ç¡¢ÊÖ¤êÃͤϠNaN ¤È¤Ê¤ë¡£
110
111 .I x
112 ¤¬ +1 ¤Î¾ì¹ç¡¢
113 .RI ( y
114 ¤¬ NaN ¤Ç¤¢¤Ã¤¿¤È¤·¤Æ¤â) ÊÖ¤êÃͤϠ1.0 ¤È¤Ê¤ë¡£
115
116 .I y
117 ¤¬ 0 ¤Î¾ì¹ç¡¢
118 .RI ( x
119 ¤¬ NaN ¤Ç¤¢¤Ã¤¿¤È¤·¤Æ¤â) ÊÖ¤êÃͤϠ1.0 ¤È¤Ê¤ë¡£
120
121 .I x
122 ¤¬ +0 (\-0) ¤Ç
123 .I y
124 ¤¬ 0 ¤è¤êÂ礭¤Ê´ñ¿ô¤Î¾ì¹ç¡¢ÊÖ¤êÃͤϠ+0 (\-0) ¤È¤Ê¤ë¡£
125
126 .I x
127 ¤¬ 0 ¤Ç¡¢
128 .I y
129 ¤¬ 0 ¤è¤êÂ礭¤¯´ñ¿ô¤Ç¤Ê¤¤¾ì¹ç¡¢ÊÖ¤êÃͤϠ+0 ¤È¤Ê¤ë¡£
130
131 .I x
132 ¤¬ \-1 ¤Ç¡¢
133 .I y
134 ¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃͤϠ1.0 ¤È¤Ê¤ë¡£
135
136 .I x
137 ¤ÎÀäÂÐÃͤ¬ 1 Ì¤Ëþ¤Ç¡¢
138 .I y
139 ¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£
140
141 .I x
142 ÀäÂÐÃͤ¬ 1 ¤è¤êÂ礭¤¯¡¢
143 .I y
144 ¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃͤϠ+0 ¤È¤Ê¤ë¡£
145
146 .I x
147 ¤ÎÀäÂÐÃͤ¬ 1 Ì¤Ëþ¤Ç¡¢
148 .I y
149 ¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃͤϠ+0 ¤È¤Ê¤ë¡£
150
151 .I x
152 ¤ÎÀäÂÐÃͤ¬ 1 ¤è¤êÂ礭¤¯¡¢
153 .I y
154 ¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£
155
156 .I x
157 ¤¬Éé¤Î̵¸ÂÂç¤Ç¡¢
158 .I y
159 ¤¬ 0 ¤è¤ê¾®¤µ¤¤´ñ¿ô¤Î¾ì¹ç¡¢ÊÖ¤êÃͤϠ\-0 ¤È¤Ê¤ë¡£
160
161 .I x
162 ¤¬Éé¤Î̵¸ÂÂç¤Ç¡¢
163 .I y
164 ¤¬ 0 ¤è¤ê¾®¤µ¤¯´ñ¿ô¤Ç¤Ê¤¤¾ì¹ç¡¢ÊÖ¤êÃͤϠ+0 ¤È¤Ê¤ë¡£
165
166 .I x
167 ¤¬Éé¤Î̵¸ÂÂç¤Ç¡¢
168 .I y
169 ¤¬ 0 ¤è¤êÂ礭¤¤´ñ¿ô¤Î¾ì¹ç¡¢ÊÖ¤êÃͤÏÉé¤Î̵¸ÂÂç¤È¤Ê¤ë¡£
170
171 .I x
172 ¤¬Éé¤Î̵¸ÂÂç¤Ç¡¢
173 .I y
174 ¤¬ 0 ¤è¤êÂ礭¤¯´ñ¿ô¤Ç¤Ê¤¤¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£
175
176 .I x
177 ¤¬Àµ¤Î̵¸ÂÂç¤Ç¡¢
178 .I y
179 ¤¬ 0 Ì¤Ëþ¤Î¾ì¹ç¡¢ÊÖ¤êÃͤϠ+0 ¤È¤Ê¤ë¡£
180
181 .I x
182 ¤¬Àµ¤Î̵¸ÂÂç¤Ç¡¢
183 .I y
184 ¤¬ 0 ¤è¤êÂ礭¤¤¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£
185
186 .I x
187 ¤¬ +0 ¤« \-0 ¤Ç¡¢
188 .I y
189 ¤¬ 0 ¤è¤ê¾®¤µ¤¤´ñ¿ô¤Î¾ì¹ç¡¢
190 ¶Ë¥¨¥é¡¼ (pole error) ¤¬È¯À¸¤·¡¢ÊÖ¤êÃͤÏ
191 .BR HUGE_VAL ,
192 .BR HUGE_VALF ,
193 .BR HUGE_VALL
194 ¤È¤Ê¤ë¡£
195 .I x
196 ¤ÈƱ¤¸Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£
197
198 .I x
199 ¤¬ +0 ¤« \-0 ¤Ç¡¢
200 .I y
201 ¤¬ 0 ¤è¤ê¾®¤µ¤¯´ñ¿ô¤Ç¤Ê¤¤¾ì¹ç¡¢
202 ¶Ë¥¨¥é¡¼¤¬È¯À¸¤·¡¢
203 .\" The pole error is generated at least as far back as glibc 2.4
204 ÊÖ¤êÃͤÏ
205 .BR + HUGE_VAL ,
206 .BR + HUGE_VALF ,
207 .BR + HUGE_VALL
208 ¤È¤Ê¤ë¡£
209 .SH ¥¨¥é¡¼
210 .\" FIXME . review status of this error
211 .\" longstanding bug report for glibc:
212 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=369
213 .\" For negative x, and -large and +large y, glibc 2.8 gives incorrect
214 .\" results
215 .\" pow(-0.5,-DBL_MAX)=nan
216 .\" EDOM FE_INVALID nan; fail-errno fail-except fail-result;
217 .\" FAIL (expected: range-error-overflow (ERANGE, FE_OVERFLOW); +INF)
218 .\"
219 .\" pow(-1.5,-DBL_MAX)=nan
220 .\" EDOM FE_INVALID nan; fail-errno fail-except fail-result;
221 .\" FAIL (expected: range-error-underflow (ERANGE, FE_UNDERFLOW); +0)
222 .\"
223 .\" pow(-0.5,DBL_MAX)=nan
224 .\" EDOM FE_INVALID nan; fail-errno fail-except fail-result;
225 .\" FAIL (expected: range-error-underflow (ERANGE, FE_UNDERFLOW); +0)
226 .\"
227 .\" pow(-1.5,DBL_MAX)=nan
228 .\" EDOM FE_INVALID nan; fail-errno fail-except fail-result;
229 .\" FAIL (expected: range-error-overflow (ERANGE, FE_OVERFLOW); +INF)
230 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
231 .BR math_error (7)
232 ¤ò»²¾È¤Î¤³¤È¡£
233 .PP
234 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
235 .TP
236 Îΰ襨¥é¡¼: \fIx\fP ¤¬Éé¤Ç¡¢\fIy\fP ¤¬À°¿ô¤Ç¤Ê¤¤Í­¸ÂÃÍ
237 .I errno
238 ¤Ë
239 .B EDOM
240 ¤¬ÀßÄꤵ¤ì¤ë¡£
241 ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³°
242 .RB ( FE_INVALID )
243 ¤¬¾å¤¬¤ë¡£
244 .TP
245 ¶Ë¥¨¥é¡¼: \fIx\fP ¤¬¥¼¥í¤Ç¡¢\fIy\fP ¤¬Éé
246 .I errno
247 ¤Ë
248 .B ERANGE
249 ¤¬ÀßÄꤵ¤ì¤ë¡£
250 0 ¤Ë¤è¤ë½ü»» (divide-by-zero) ÉâÆ°¾®¿ôÅÀÎã³°
251 .RB ( FE_DIVBYZERO )
252 ¤¬¾å¤¬¤ë¡£
253 .TP
254 ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼
255 .I errno
256 ¤Ë
257 .B ERANGE
258 ¤¬ÀßÄꤵ¤ì¤ë¡£
259 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
260 .RB ( FE_OVERFLOW )
261 ¤¬¾å¤¬¤ë¡£
262 .TP
263 ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼
264 .I errno
265 ¤Ë
266 .B ERANGE
267 ¤¬ÀßÄꤵ¤ì¤ë¡£
268 ¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
269 .RB ( FE_UNDERFLOW )
270 ¤¬¾å¤¬¤ë¡£
271 .SH ½àµò
272 C99, POSIX.1-2001.
273 .I double
274 ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£
275 .SH ¥Ð¥°
276 .\"
277 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776
278 .\" or possibly 2.9, I haven't found the source code change
279 .\" and I don't have a 2.9 system to test
280 glibc 2.9 ¤È¤½¤ì°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢
281 ¶Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¡¢POSIX ¤ÇÍ׵ᤵ¤ì¤Æ¤¤¤ë
282 .B ERANGE
283 ¤Ç¤Ï¤Ê¤¯
284 .B EDOM
285 ¤¬
286 .I errno
287 ¤ËÀßÄꤵ¤ì¤ë¡£
288 ¥Ð¡¼¥¸¥ç¥ó 2.10 °Ê¹ß¤Î glibc ¤Ç¤Ï¡¢Àµ¤·¤¤Æ°ºî¤ò¤¹¤ë¡£
289
290 .I x
291 ¤¬Éé¤Î¾ì¹ç¡¢Â礭¤ÊÀµÉé¤ÎÃͤÎ
292 .I y
293 ¤¬Í¿¤¨¤é¤ì¤ë¤È¡¢´Ø¿ô¤Î·ë²Ì¤¬ NaN ¤È¤Ê¤ê¡¢
294 .I errno
295 ¤Ë
296 .B EDOM
297 ¤¬ÀßÄꤵ¤ì¡¢
298 ÉÔÀµÉâÆ°¾®¿ôÅÀÎã³°
299 .RB ( FE_INVALID )
300 ¤¬È¯À¸¤¹¤ë¡£
301 Î㤨¤Ð¡¢
302 .BR pow ()
303 ¤Ç¤Ï¡¢
304 .I y
305 ¤ÎÀäÂÐÃͤ¬Ìó 9.223373e18 ¤è¤êÂ礭¤¤¾ì¹ç¤Ë¤³¤Î¾õ¶·¤È¤Ê¤ë¡£
306 .\" see bug http://sources.redhat.com/bugzilla/show_bug.cgi?id=3866
307 .\" and http://sources.redhat.com/bugzilla/show_bug.cgi?id=369
308
309 glibc ¥Ð¡¼¥¸¥ç¥ó 2.3.2 °ÊÁ°¤Ç¤Ï¡¢
310 .\" FIXME . Actually, 2.3.2 is the earliest test result I have; so yet
311 .\" to confirm if this error occurs only in 2.3.2.
312 ¥¢¥ó¥À¡¼¥Õ¥í¡¼¤ä¥¢¥ó¥À¡¼¥Õ¥í¡¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¾ì¹ç¡¢
313 glibc ¤Î
314 .BR pow ()
315 ¤Ï¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼Îã³°¤ä¥¢¥ó¥À¡¼¥Õ¥í¡¼Îã³°¤ò¾å¤²¤ë¤À¤±¤Ç¤Ê¤¯¡¢
316 ÉÔÀµÉâÆ°¾®¿ôÅÀÎã³°
317 .RB ( FE_INVALID )
318 ¤ò´Ö°ã¤Ã¤ÆȯÀ¸¤¹¤ë¡£
319 .SH ´ØÏ¢¹àÌÜ
320 .BR cbrt (3),
321 .BR cpow (3),
322 .BR sqrt (3)