OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / draft / man3 / hypot.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified 2002-07-27 by Walter Harms
29 .\"     (walter.harms@informatik.uni-oldenburg.de)
30 .\"
31 .\" Japanese Version Copyright (c) 1996 Kenji Kajiwara
32 .\"         all rights reserved.
33 .\" Translated Mon Jul 15 18:20:00 JST 1996
34 .\"         by Kenji Kajiwara
35 .\" Proof Reading: Takashi Yoshino
36 .\" Updated & Modified Sun Jun  6 05:30:45 JST 2004
37 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
38 .\" Updated & Modified Sat Jan 15 02:32:55 JST 2005 by Yuichi SATO
39 .\" Updated 2008-09-18, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
40 .\"
41 .TH HYPOT 3 2008-08-05 ""  "Linux Programmer's Manual"
42 .\"O .SH NAME
43 .SH Ì¾Á°
44 .\"O hypot, hypotf, hypotl \- Euclidean distance function
45 hypot, hypotf, hypotl \- ¥æ¡¼¥¯¥ê¥Ã¥Éµ÷Î¥´Ø¿ô
46 .\"O .SH SYNOPSIS
47 .SH ½ñ¼°
48 .nf
49 .B #include <math.h>
50 .sp
51 .BI "double hypot(double " x ", double " y );
52 .br
53 .BI "float hypotf(float " x ", float " y );
54 .br
55 .BI "long double hypotl(long double " x ", long double " y );
56 .fi
57 .sp
58 .\"O Link with \fI\-lm\fP.
59 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
60 .sp
61 .in -4n
62 .\"O Feature Test Macro Requirements for glibc (see
63 .\"O .BR feature_test_macros (7)):
64 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
65 .RB ( feature_test_macros (7)
66 »²¾È):
67 .in
68 .sp
69 .ad l
70 .BR hypot ():
71 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or
72 .I cc\ -std=c99
73 .br
74 .BR hypotf (),
75 .BR hypotl ():
76 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
77 .I cc\ -std=c99
78 .ad b
79 .\"O .SH DESCRIPTION
80 .SH ÀâÌÀ
81 .\"O The
82 .\"O .BR hypot ()
83 .\"O function returns
84 .\"O .RI sqrt( x * x + y * y ).
85 .BR hypot ()
86 ´Ø¿ô¤Ï
87 .RI sqrt( x * x + y * y )
88 ¤ÎÃͤòÊÖ¤¹¡£
89 .\"O This is the length of the hypotenuse of a right-angled triangle
90 .\"O with sides of length
91 .\"O .I x
92 .\"O and
93 .\"O .IR y ,
94 .\"O or the distance of the point
95 .\"O .RI ( x , y )
96 .\"O from the origin.
97 ¤³¤ì¤Ï
98 ľ³Ñ¤ò¶´¤à 2 ÊÕ¤ÎŤµ¤¬
99 .I x
100 ¤È
101 .I y
102 ¤Ç¤¢¤ëľ³Ñ»°³Ñ·Á¤Î¼ÐÊÕ¤ÎŤµ¡¢
103 ¤¹¤Ê¤ï¤Á¡¢¸¶ÅÀ¤ÈÅÀ
104 .RI ( x , y )
105 ¤È¤Îµ÷Î¥¤Ç¤¢¤ë¡£
106
107 .\"O The calculation is performed without undue overflow or underflow
108 .\"O during the intermediate steps of the calculation.
109 ·×»»¤ÎÃæ´Ö¥¹¥Æ¥Ã¥×¤Ç¤Ï¡¢É¬Íװʾå¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ä¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¬
110 µ¯¤­¤Ê¤¤¤è¤¦¤Ë¤·¤Æ·×»»¤¬¼Â¹Ô¤µ¤ì¤ë¡£
111 .\" e.g., hypot(DBL_MIN, DBL_MIN) does the right thing, as does, say
112 .\" hypot(DBL_MAX/2.0, DBL_MAX/2.0).
113 .\"O .SH RETURN VALUE
114 .SH ÊÖ¤êÃÍ
115 .\"O On success, these functions return the length of a right-angled triangle
116 .\"O with sides of length
117 .\"O .I x
118 .\"O and
119 .\"O .IR y .
120 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢
121 ľ³Ñ¤ò¶´¤à 2 ÊÕ¤ÎŤµ¤¬
122 .I x
123 ¤È
124 .I y
125 ¤Ç¤¢¤ëľ³Ñ»°³Ñ·Á¤Î¼ÐÊÕ¤ÎŤµ¤òÊÖ¤¹¡£
126
127 .\"O If
128 .\"O .I x
129 .\"O or
130 .\"O .I y
131 .\"O is an infinity,
132 .\"O positive infinity is returned.
133 .I x
134 ¤«
135 .I y
136 ¤¬Ìµ¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£
137
138 .\"O If
139 .\"O .I x
140 .\"O or
141 .\"O .I y
142 .\"O is a NaN,
143 .\"O and the other argument is not an infinity,
144 .\"O a NaN is returned.
145 .I x
146 ¤«
147 .I y
148 ¤Î°ìÊý¤¬ NaN ¤Ç¡¢¤â¤¦°ìÊý¤¬Ìµ¸ÂÂç¤Ç¤Ê¤¤¾ì¹ç¡¢
149 NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
150
151 .\"O If the result overflows,
152 .\"O a range error occurs,
153 .\"O and the functions return
154 .\"O .BR HUGE_VAL ,
155 .\"O .BR HUGE_VALF ,
156 .\"O or
157 .\"O .BR HUGE_VALL ,
158 .\"O respectively.
159 ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢
160 ³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì
161 .BR HUGE_VAL ,
162 .BR HUGE_VALF ,
163 .B HUGE_VALL
164 ¤òÊÖ¤¹¡£
165
166 .\"O If both arguments are subnormal, and the result is subnormal,
167 ξÊý¤Î°ú¤­¿ô¤¬ÈóÀµµ¬²½¿ô (subnormal) ¤Ç¡¢·ë²Ì¤âÈóÀµµ¬²½¿ô (subnormal) ¤Î¾ì¹ç¡¢
168 .\" Actually, could the result not be subnormal if both arguments
169 .\" are subnormal?  I think not -- mtk, Jul 2008
170 .\"O a range error occurs,
171 .\"O and the correct result is returned.
172 ÈÏ°Ï¥¨¥é¡¼¤¬È¯À¸¤·¡¢Àµ¤·¤¤·ë²Ì¤¬ÊÖ¤µ¤ì¤ë¡£
173 .\"O .SH ERRORS
174 .SH ¥¨¥é¡¼
175 .\"O See
176 .\"O .BR math_error (7)
177 .\"O for information on how to determine whether an error has occurred
178 .\"O when calling these functions.
179 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
180 .BR math_error (7)
181 ¤ò»²¾È¤Î¤³¤È¡£
182 .PP
183 .\"O The following errors can occur:
184 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
185 .TP
186 .\"O Range error: result overflow
187 ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼
188 .\"O .I errno
189 .\"O is set to
190 .\"O .BR ERANGE .
191 .\"O An overflow floating-point exception
192 .\"O .RB ( FE_OVERFLOW )
193 .\"O is raised.
194 .I errno
195 ¤Ë
196 .B ERANGE
197 ¤¬ÀßÄꤵ¤ì¤ë¡£
198 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
199 .RB ( FE_OVERFLOW )
200 ¤¬¾å¤¬¤ë¡£
201 .TP
202 .\"O Range error: result underflow
203 ÈÏ°Ï¥¨¥é¡¼: ·ë²Ì¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼
204 .\" .I errno
205 .\" is set to
206 .\" .BR ERANGE .
207 .\"O An underflow floating-point exception
208 .\"O .RB ( FE_UNDERFLOW )
209 .\"O is raised.
210 ¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
211 .RB ( FE_UNDERFLOW )
212 ¤¬¾å¤¬¤ë¡£
213 .IP
214 .\"O These functions do not set
215 .\"O .IR errno
216 .\"O for this case.
217 ¤³¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï
218 .I errno
219 ¤òÀßÄꤷ¤Ê¤¤¡£
220 .\" FIXME . Is it intentional that these functions do not set errno?
221 .\" They do set errno for the overflow case.
222 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6795
223 .\"O .SH "CONFORMING TO"
224 .SH ½àµò
225 C99, POSIX.1-2001.
226 .\"O The variant returning
227 .\"O .I double
228 .\"O also conforms to
229 .\"O SVr4, 4.3BSD.
230 .I double
231 ÈǤδؿô¤Ï SVr4, 4.3BSD ¤Ë¤â½àµò¤·¤Æ¤¤¤ë¡£
232 .\"O .SH "SEE ALSO"
233 .SH ´ØÏ¢¹àÌÜ
234 .BR cabs (3),
235 .BR sqrt (3)