OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / man3 / hypot.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
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 2002-07-27 by Walter Harms
31 .\"     (walter.harms@informatik.uni-oldenburg.de)
32 .\"
33 .\"*******************************************************************
34 .\"
35 .\" This file was generated with po4a. Translate the source file.
36 .\"
37 .\"*******************************************************************
38 .TH HYPOT 3 2010\-09\-20 "" "Linux Programmer's Manual"
39 .SH 名前
40 hypot, hypotf, hypotl \- ユークリッド距離関数
41 .SH 書式
42 .nf
43 \fB#include <math.h>\fP
44 .sp
45 \fBdouble hypot(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP
46 .br
47 \fBfloat hypotf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP
48 .br
49 \fBlong double hypotl(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP
50 .fi
51 .sp
52 \fI\-lm\fP でリンクする。
53 .sp
54 .in -4n
55 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
56 .in
57 .sp
58 .ad l
59 \fBhypot\fP():
60 .RS 4
61 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE ||
62 _POSIX_C_SOURCE\ >=\ 200112L;
63 .br
64 or \fIcc\ \-std=c99\fP
65 .RE
66 .br
67 \fBhypotf\fP(), \fBhypotl\fP():
68 .RS 4
69 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE
70 || _POSIX_C_SOURCE\ >=\ 200112L;
71 .br
72 or \fIcc\ \-std=c99\fP
73 .RE
74 .ad b
75 .SH 説明
76 \fBhypot\fP()  関数は sqrt(\fIx\fP*\fIx\fP+\fIy\fP*\fIy\fP)  の値を返す。 これは 直角を挟む 2 辺の長さが \fIx\fP と
77 \fIy\fP である直角三角形の斜辺の長さ、 すなわち、原点と点 (\fIx\fP,\fIy\fP)  との距離である。
78
79 .\" e.g., hypot(DBL_MIN, DBL_MIN) does the right thing, as does, say
80 .\" hypot(DBL_MAX/2.0, DBL_MAX/2.0).
81 計算の中間ステップでは、必要以上のオーバーフローやアンダーフローが 起きないようにして計算が実行される。
82 .SH 返り値
83 成功すると、これらの関数は、 直角を挟む 2 辺の長さが \fIx\fP と \fIy\fP である直角三角形の斜辺の長さを返す。
84
85 \fIx\fP か \fIy\fP が無限大の場合、正の無限大が返される。
86
87 \fIx\fP か \fIy\fP の一方が NaN で、もう一方が無限大でない場合、 NaN が返される。
88
89 結果がオーバーフローする場合、範囲エラー (range error) が発生し、 各関数はそれぞれ \fBHUGE_VAL\fP, \fBHUGE_VALF\fP,
90 \fBHUGE_VALL\fP を返す。
91
92 .\" Actually, could the result not be subnormal if both arguments
93 .\" are subnormal?  I think not -- mtk, Jul 2008
94 両方の引き数が非正規化数 (subnormal) で、結果も非正規化数 (subnormal) の場合、 範囲エラーが発生し、正しい結果が返される。
95 .SH エラー
96 これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7)  を参照のこと。
97 .PP
98 以下のエラーが発生する可能性がある。
99 .TP 
100 範囲エラー (range error): 結果のオーバーフロー
101 \fIerrno\fP に \fBERANGE\fP が設定される。 オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP)  が上がる。
102 .TP 
103 範囲エラー (range error): 結果のアンダーフロー
104 .\" .I errno
105 .\" is set to
106 .\" .BR ERANGE .
107 アンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP)  が上がる。
108 .IP
109 .\" FIXME . Is it intentional that these functions do not set errno?
110 .\" They do set errno for the overflow case.
111 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6795
112 これらの関数は、この場合に \fIerrno\fP を設定しない。
113 .SH 準拠
114 C99, POSIX.1\-2001.  \fIdouble\fP 版の関数は SVr4, 4.3BSD にも準拠している。
115 .SH 関連項目
116 \fBcabs\fP(3), \fBsqrt\fP(3)
117 .SH この文書について
118 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
119 である。プロジェクトの説明とバグ報告に関する情報は
120 http://www.kernel.org/doc/man\-pages/ に書かれている。