OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[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 2010-09-20 ""  "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 .RS 4
72 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE ||
73 _POSIX_C_SOURCE\ >=\ 200112L;
74 .br
75 or
76 .I cc\ -std=c99
77 .RE
78 .br
79 .BR hypotf (),
80 .BR hypotl ():
81 .RS 4
82 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
83 _POSIX_C_SOURCE\ >=\ 200112L;
84 .br
85 or
86 .I cc\ -std=c99
87 .RE
88 .ad b
89 .\"O .SH DESCRIPTION
90 .SH 説明
91 .\"O The
92 .\"O .BR hypot ()
93 .\"O function returns
94 .\"O .RI sqrt( x * x + y * y ).
95 .BR hypot ()
96 関数は
97 .RI sqrt( x * x + y * y )
98 の値を返す。
99 .\"O This is the length of the hypotenuse of a right-angled triangle
100 .\"O with sides of length
101 .\"O .I x
102 .\"O and
103 .\"O .IR y ,
104 .\"O or the distance of the point
105 .\"O .RI ( x , y )
106 .\"O from the origin.
107 これは
108 直角を挟む 2 辺の長さが
109 .I x
110
111 .I y
112 である直角三角形の斜辺の長さ、
113 すなわち、原点と点
114 .RI ( x , y )
115 との距離である。
116
117 .\"O The calculation is performed without undue overflow or underflow
118 .\"O during the intermediate steps of the calculation.
119 計算の中間ステップでは、必要以上のオーバーフローやアンダーフローが
120 起きないようにして計算が実行される。
121 .\" e.g., hypot(DBL_MIN, DBL_MIN) does the right thing, as does, say
122 .\" hypot(DBL_MAX/2.0, DBL_MAX/2.0).
123 .\"O .SH RETURN VALUE
124 .SH 返り値
125 .\"O On success, these functions return the length of a right-angled triangle
126 .\"O with sides of length
127 .\"O .I x
128 .\"O and
129 .\"O .IR y .
130 成功すると、これらの関数は、
131 直角を挟む 2 辺の長さが
132 .I x
133
134 .I y
135 である直角三角形の斜辺の長さを返す。
136
137 .\"O If
138 .\"O .I x
139 .\"O or
140 .\"O .I y
141 .\"O is an infinity,
142 .\"O positive infinity is returned.
143 .I x
144
145 .I y
146 が無限大の場合、正の無限大が返される。
147
148 .\"O If
149 .\"O .I x
150 .\"O or
151 .\"O .I y
152 .\"O is a NaN,
153 .\"O and the other argument is not an infinity,
154 .\"O a NaN is returned.
155 .I x
156
157 .I y
158 の一方が NaN で、もう一方が無限大でない場合、
159 NaN が返される。
160
161 .\"O If the result overflows,
162 .\"O a range error occurs,
163 .\"O and the functions return
164 .\"O .BR HUGE_VAL ,
165 .\"O .BR HUGE_VALF ,
166 .\"O or
167 .\"O .BR HUGE_VALL ,
168 .\"O respectively.
169 結果がオーバーフローする場合、範囲エラー (range error) が発生し、
170 各関数はそれぞれ
171 .BR HUGE_VAL ,
172 .BR HUGE_VALF ,
173 .B HUGE_VALL
174 を返す。
175
176 .\"O If both arguments are subnormal, and the result is subnormal,
177 両方の引き数が非正規化数 (subnormal) で、結果も非正規化数 (subnormal) の場合、
178 .\" Actually, could the result not be subnormal if both arguments
179 .\" are subnormal?  I think not -- mtk, Jul 2008
180 .\"O a range error occurs,
181 .\"O and the correct result is returned.
182 範囲エラーが発生し、正しい結果が返される。
183 .\"O .SH ERRORS
184 .SH エラー
185 .\"O See
186 .\"O .BR math_error (7)
187 .\"O for information on how to determine whether an error has occurred
188 .\"O when calling these functions.
189 これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は
190 .BR math_error (7)
191 を参照のこと。
192 .PP
193 .\"O The following errors can occur:
194 以下のエラーが発生する可能性がある。
195 .TP
196 .\"O Range error: result overflow
197 範囲エラー: 結果のオーバーフロー
198 .\"O .I errno
199 .\"O is set to
200 .\"O .BR ERANGE .
201 .\"O An overflow floating-point exception
202 .\"O .RB ( FE_OVERFLOW )
203 .\"O is raised.
204 .I errno
205
206 .B ERANGE
207 が設定される。
208 オーバーフロー浮動小数点例外
209 .RB ( FE_OVERFLOW )
210 が上がる。
211 .TP
212 .\"O Range error: result underflow
213 範囲エラー: 結果のアンダーフロー
214 .\" .I errno
215 .\" is set to
216 .\" .BR ERANGE .
217 .\"O An underflow floating-point exception
218 .\"O .RB ( FE_UNDERFLOW )
219 .\"O is raised.
220 アンダーフロー浮動小数点例外
221 .RB ( FE_UNDERFLOW )
222 が上がる。
223 .IP
224 .\"O These functions do not set
225 .\"O .IR errno
226 .\"O for this case.
227 この場合、これらの関数は
228 .I errno
229 を設定しない。
230 .\" FIXME . Is it intentional that these functions do not set errno?
231 .\" They do set errno for the overflow case.
232 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6795
233 .\"O .SH "CONFORMING TO"
234 .SH 準拠
235 C99, POSIX.1-2001.
236 .\"O The variant returning
237 .\"O .I double
238 .\"O also conforms to
239 .\"O SVr4, 4.3BSD.
240 .I double
241 版の関数は SVr4, 4.3BSD にも準拠している。
242 .\"O .SH "SEE ALSO"
243 .SH 関連項目
244 .BR cabs (3),
245 .BR sqrt (3)