OSDN Git Service

2e42ab58e8fbbfdfcecfc3d1d58c64e8b8689ac0
[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  2008-08-10 "" "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 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
66 .I cc\ -std=c99
67 .ad b
68 .SH ÀâÌÀ
69 .BR pow ()
70 ´Ø¿ô¤Ï \fIx\fP ¤Î \fIy\fP ¾è¤ÎÃͤòÊÖ¤¹¡£
71 .SH ÊÖ¤êÃÍ
72 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï
73 .I x
74 ¤Î
75 .I y
76 ¾è¤ÎÃͤòÊÖ¤¹¡£
77
78 .I x
79 ¤¬ 0 Ì¤Ëþ¤ÎÍ­¸ÂÃͤÇ
80 .I y
81 ¤¬À°¿ô¤Ç¤Ê¤¤Í­¸ÂÃͤξì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢
82 .\" The domain error is generated at least as far back as glibc 2.4
83 NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
84
85 ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢
86 ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢
87 .\" The range error is generated at least as far back as glibc 2.4
88 ³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì
89 .BR HUGE_VAL ,
90 .BR HUGE_VALF ,
91 .BR HUGE_VALL
92 ¤òÊÖ¤¹¡£ÊÖ¤êÃͤˤϿô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£
93
94 ·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤·¡¢¤½¤ÎÃͤ¬É½¸½²Äǽ¤Ç¤Ê¤¤¾ì¹ç¡¢
95 ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢ 0.0 ¤¬ÊÖ¤µ¤ì¤ë¡£
96 .\" POSIX.1 does not specify the sign of the zero,
97 .\" but http://sources.redhat.com/bugzilla/show_bug.cgi?id=2678
98 .\" points out that the zero has the wrong sign in some cases.
99
100 °Ê²¼¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¡¢
101 .I x
102 ¤«
103 .I y
104 ¤¬ NaN ¤Î¾ì¹ç¡¢ÊÖ¤êÃͤϠNaN ¤È¤Ê¤ë¡£
105
106 .I x
107 ¤¬ +1 ¤Î¾ì¹ç¡¢
108 .RI ( y
109 ¤¬ NaN ¤Ç¤¢¤Ã¤¿¤È¤·¤Æ¤â) ÊÖ¤êÃͤϠ1.0 ¤È¤Ê¤ë¡£
110
111 .I y
112 ¤¬ 0 ¤Î¾ì¹ç¡¢
113 .RI ( x
114 ¤¬ NaN ¤Ç¤¢¤Ã¤¿¤È¤·¤Æ¤â) ÊÖ¤êÃͤϠ1.0 ¤È¤Ê¤ë¡£
115
116 .I x
117 ¤¬ +0 (\-0) ¤Ç
118 .I y
119 ¤¬ 0 ¤è¤êÂ礭¤Ê´ñ¿ô¤Î¾ì¹ç¡¢ÊÖ¤êÃͤϠ+0 (\-0) ¤È¤Ê¤ë¡£
120
121 .I x
122 ¤¬ 0 ¤Ç¡¢
123 .I y
124 ¤¬ 0 ¤è¤êÂ礭¤¯´ñ¿ô¤Ç¤Ê¤¤¾ì¹ç¡¢ÊÖ¤êÃͤϠ+0 ¤È¤Ê¤ë¡£
125
126 .I x
127 ¤¬ \-1 ¤Ç¡¢
128 .I y
129 ¤¬Àµ¤Î̵¸ÂÂ礫Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃͤϠ1.0 ¤È¤Ê¤ë¡£
130
131 .I x
132 ¤ÎÀäÂÐÃͤ¬ 1 Ì¤Ëþ¤Ç¡¢
133 .I y
134 ¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£
135
136 .I x
137 ÀäÂÐÃͤ¬ 1 ¤è¤êÂ礭¤¯¡¢
138 .I y
139 ¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃͤϠ+0 ¤È¤Ê¤ë¡£
140
141 .I x
142 ¤ÎÀäÂÐÃͤ¬ 1 Ì¤Ëþ¤Ç¡¢
143 .I y
144 ¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃͤϠ+0 ¤È¤Ê¤ë¡£
145
146 .I x
147 ¤ÎÀäÂÐÃͤ¬ 1 ¤è¤êÂ礭¤¯¡¢
148 .I y
149 ¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£
150
151 .I x
152 ¤¬Éé¤Î̵¸ÂÂç¤Ç¡¢
153 .I y
154 ¤¬ 0 ¤è¤ê¾®¤µ¤¤´ñ¿ô¤Î¾ì¹ç¡¢ÊÖ¤êÃͤϠ\-0 ¤È¤Ê¤ë¡£
155
156 .I x
157 ¤¬Éé¤Î̵¸ÂÂç¤Ç¡¢
158 .I y
159 ¤¬ 0 ¤è¤ê¾®¤µ¤¯´ñ¿ô¤Ç¤Ê¤¤¾ì¹ç¡¢ÊÖ¤êÃͤϠ+0 ¤È¤Ê¤ë¡£
160
161 .I x
162 ¤¬Éé¤Î̵¸ÂÂç¤Ç¡¢
163 .I y
164 ¤¬ 0 ¤è¤êÂ礭¤¤´ñ¿ô¤Î¾ì¹ç¡¢ÊÖ¤êÃͤÏÉé¤Î̵¸ÂÂç¤È¤Ê¤ë¡£
165
166 .I x
167 ¤¬Éé¤Î̵¸ÂÂç¤Ç¡¢
168 .I y
169 ¤¬ 0 ¤è¤êÂ礭¤¯´ñ¿ô¤Ç¤Ê¤¤¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£
170
171 .I x
172 ¤¬Àµ¤Î̵¸ÂÂç¤Ç¡¢
173 .I y
174 ¤¬ 0 Ì¤Ëþ¤Î¾ì¹ç¡¢ÊÖ¤êÃͤϠ+0 ¤È¤Ê¤ë¡£
175
176 .I x
177 ¤¬Àµ¤Î̵¸ÂÂç¤Ç¡¢
178 .I y
179 ¤¬ 0 ¤è¤êÂ礭¤¤¾ì¹ç¡¢ÊÖ¤êÃͤÏÀµ¤Î̵¸ÂÂç¤È¤Ê¤ë¡£
180
181 .I x
182 ¤¬ +0 ¤« \-0 ¤Ç¡¢
183 .I y
184 ¤¬ 0 ¤è¤ê¾®¤µ¤¤´ñ¿ô¤Î¾ì¹ç¡¢
185 ¶Ë¥¨¥é¡¼ (pole error) ¤¬È¯À¸¤·¡¢ÊÖ¤êÃͤÏ
186 .BR HUGE_VAL ,
187 .BR HUGE_VALF ,
188 .BR HUGE_VALL
189 ¤È¤Ê¤ë¡£
190 .I x
191 ¤ÈƱ¤¸Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£
192
193 .I x
194 ¤¬ +0 ¤« \-0 ¤Ç¡¢
195 .I y
196 ¤¬ 0 ¤è¤ê¾®¤µ¤¯´ñ¿ô¤Ç¤Ê¤¤¾ì¹ç¡¢
197 ¶Ë¥¨¥é¡¼¤¬È¯À¸¤·¡¢
198 .\" The pole error is generated at least as far back as glibc 2.4
199 ÊÖ¤êÃͤÏ
200 .BR + HUGE_VAL ,
201 .BR + HUGE_VALF ,
202 .BR + HUGE_VALL
203 ¤È¤Ê¤ë¡£
204 .SH ¥¨¥é¡¼
205 .\" FIXME . review status of this error
206 .\" longstanding bug report for glibc:
207 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=369
208 .\" For negative x, and -large and +large y, glibc 2.8 gives incorrect
209 .\" results
210 .\" pow(-0.5,-DBL_MAX)=nan
211 .\" EDOM FE_INVALID nan; fail-errno fail-except fail-result;
212 .\" FAIL (expected: range-error-overflow (ERANGE, FE_OVERFLOW); +INF)
213 .\"
214 .\" pow(-1.5,-DBL_MAX)=nan
215 .\" EDOM FE_INVALID nan; fail-errno fail-except fail-result;
216 .\" FAIL (expected: range-error-underflow (ERANGE, FE_UNDERFLOW); +0)
217 .\"
218 .\" pow(-0.5,DBL_MAX)=nan
219 .\" EDOM FE_INVALID nan; fail-errno fail-except fail-result;
220 .\" FAIL (expected: range-error-underflow (ERANGE, FE_UNDERFLOW); +0)
221 .\"
222 .\" pow(-1.5,DBL_MAX)=nan
223 .\" EDOM FE_INVALID nan; fail-errno fail-except fail-result;
224 .\" FAIL (expected: range-error-overflow (ERANGE, FE_OVERFLOW); +INF)
225 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
226 .BR math_error (7)
227 ¤ò»²¾È¤Î¤³¤È¡£
228 .PP
229 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
230 .TP
231 Îΰ襨¥é¡¼: \fIx\fP ¤¬Éé¤Ç¡¢\fIy\fP ¤¬À°¿ô¤Ç¤Ê¤¤Í­¸ÂÃÍ
232 .I errno
233 ¤Ë
234 .B EDOM
235 ¤¬ÀßÄꤵ¤ì¤ë¡£
236 ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³°
237 .RB ( FE_INVALID )
238 ¤¬¾å¤¬¤ë¡£
239 .TP
240 ¶Ë¥¨¥é¡¼: \fIx\fP ¤¬¥¼¥í¤Ç¡¢\fIy\fP ¤¬Éé
241 .I errno
242 ¤Ë
243 .B ERANGE
244 ¤¬ÀßÄꤵ¤ì¤ë¡£
245 .\" FIXME . glibc 2.8 gives EDOM
246 0 ¤Ë¤è¤ë½ü»» (divide-by-zero) ÉâÆ°¾®¿ôÅÀÎã³°
247 .RB ( FE_DIVBYZERO )
248 ¤¬¾å¤¬¤ë¡£
249 .TP
250 ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼
251 .I errno
252 ¤Ë
253 .B ERANGE
254 ¤¬ÀßÄꤵ¤ì¤ë¡£
255 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
256 .RB ( FE_OVERFLOW )
257 ¤¬¾å¤¬¤ë¡£
258 .TP
259 ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼
260 .I errno
261 ¤Ë
262 .B ERANGE
263 ¤¬ÀßÄꤵ¤ì¤ë¡£
264 ¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
265 .RB ( FE_UNDERFLOW )
266 ¤¬¾å¤¬¤ë¡£
267 .SH ½àµò
268 C99, POSIX.1-2001.
269 .I double
270 ÈǤδؿô¤Ï SVr4, 4.3BSD, C89 ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£
271 .SH ¥Ð¥°
272 ¶Ë¥¨¥é¡¼¤Î¾ì¹ç¡¢
273 .\"
274 .\" FIXME . this is as at glibc 2.8; check later if this bug is fixed
275 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776
276 .I errno
277 ¤Ë
278 .B EDOM
279 ¤¬ÀßÄꤵ¤ì¤ë¡£
280 POSIX.1 ¤Îµ¬Äê¤Ç¤Ï¡¢
281 .B ERANGE
282 ¤òÀßÄꤹ¤Ù¤­¤È¤µ¤ì¤Æ¤¤¤ë¡£
283
284 .I x
285 ¤¬Éé¤Î¾ì¹ç¡¢Â礭¤ÊÀµÉé¤ÎÃͤÎ
286 .I y
287 ¤¬Í¿¤¨¤é¤ì¤ë¤È¡¢´Ø¿ô¤Î·ë²Ì¤¬ NaN ¤È¤Ê¤ê¡¢
288 .I errno
289 ¤Ë
290 .B EDOM
291 ¤¬ÀßÄꤵ¤ì¡¢
292 ÉÔÀµÉâÆ°¾®¿ôÅÀÎã³°
293 .RB ( FE_INVALID )
294 ¤¬È¯À¸¤¹¤ë¡£
295 Î㤨¤Ð¡¢
296 .BR pow ()
297 ¤Ç¤Ï¡¢
298 .I y
299 ¤ÎÀäÂÐÃͤ¬Ìó 9.223373e18 ¤è¤êÂ礭¤¤¾ì¹ç¤Ë¤³¤Î¾õ¶·¤È¤Ê¤ë¡£
300 .\" see bug http://sources.redhat.com/bugzilla/show_bug.cgi?id=3866
301 .\" and http://sources.redhat.com/bugzilla/show_bug.cgi?id=369
302
303 glibc ¥Ð¡¼¥¸¥ç¥ó 2.3.2 °ÊÁ°¤Ç¤Ï¡¢
304 .\" FIXME . Actually, 2.3.2 is the earliest test result I have; so yet
305 .\" to confirm if this error occurs only in 2.3.2.
306 ¥¢¥ó¥À¡¼¥Õ¥í¡¼¤ä¥¢¥ó¥À¡¼¥Õ¥í¡¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¾ì¹ç¡¢
307 glibc ¤Î
308 .BR pow ()
309 ¤Ï¡¢¥ª¡¼¥Ð¡¼¥Õ¥í¡¼Îã³°¤ä¥¢¥ó¥À¡¼¥Õ¥í¡¼Îã³°¤ò¾å¤²¤ë¤À¤±¤Ç¤Ê¤¯¡¢
310 ÉÔÀµÉâÆ°¾®¿ôÅÀÎã³°
311 .RB ( FE_INVALID )
312 ¤ò´Ö°ã¤Ã¤ÆȯÀ¸¤¹¤ë¡£
313 .SH ´ØÏ¢¹àÌÜ
314 .BR cbrt (3),
315 .BR cpow (3),
316 .BR sqrt (3)