OSDN Git Service

(split) LDP: Update releases to LDP v3.40.
[linuxjm/LDP_man-pages.git] / release / 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 .\"*******************************************************************
32 .\"
33 .\" This file was generated with po4a. Translate the source file.
34 .\"
35 .\"*******************************************************************
36 .TH HYPOT 3 2010\-09\-20 "" "Linux Programmer's Manual"
37 .SH 名前
38 hypot, hypotf, hypotl \- ユークリッド距離関数
39 .SH 書式
40 .nf
41 \fB#include <math.h>\fP
42 .sp
43 \fBdouble hypot(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP
44 .br
45 \fBfloat hypotf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP
46 .br
47 \fBlong double hypotl(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP
48 .fi
49 .sp
50 \fI\-lm\fP でリンクする。
51 .sp
52 .in -4n
53 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
54 .in
55 .sp
56 .ad l
57 \fBhypot\fP():
58 .RS 4
59 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE ||
60 _POSIX_C_SOURCE\ >=\ 200112L;
61 .br
62 or \fIcc\ \-std=c99\fP
63 .RE
64 .br
65 \fBhypotf\fP(), \fBhypotl\fP():
66 .RS 4
67 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE
68 || _POSIX_C_SOURCE\ >=\ 200112L;
69 .br
70 or \fIcc\ \-std=c99\fP
71 .RE
72 .ad b
73 .SH 説明
74 \fBhypot\fP()  関数は sqrt(\fIx\fP*\fIx\fP+\fIy\fP*\fIy\fP)  の値を返す。 これは 直角を挟む 2 辺の長さが \fIx\fP と
75 \fIy\fP である直角三角形の斜辺の長さ、 すなわち、原点と点 (\fIx\fP,\fIy\fP)  との距離である。
76
77 .\" e.g., hypot(DBL_MIN, DBL_MIN) does the right thing, as does, say
78 .\" hypot(DBL_MAX/2.0, DBL_MAX/2.0).
79 計算の中間ステップでは、必要以上のオーバーフローやアンダーフローが 起きないようにして計算が実行される。
80 .SH 返り値
81 成功すると、これらの関数は、 直角を挟む 2 辺の長さが \fIx\fP と \fIy\fP である直角三角形の斜辺の長さを返す。
82
83 \fIx\fP か \fIy\fP が無限大の場合、正の無限大が返される。
84
85 \fIx\fP か \fIy\fP の一方が NaN で、もう一方が無限大でない場合、 NaN が返される。
86
87 結果がオーバーフローする場合、範囲エラー (range error) が発生し、 各関数はそれぞれ \fBHUGE_VAL\fP, \fBHUGE_VALF\fP,
88 \fBHUGE_VALL\fP を返す。
89
90 .\" Actually, could the result not be subnormal if both arguments
91 .\" are subnormal?  I think not -- mtk, Jul 2008
92 両方の引き数が非正規化数 (subnormal) で、結果も非正規化数 (subnormal) の場合、 範囲エラーが発生し、正しい結果が返される。
93 .SH エラー
94 これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7)  を参照のこと。
95 .PP
96 以下のエラーが発生する可能性がある。
97 .TP 
98 範囲エラー (range error): 結果のオーバーフロー
99 \fIerrno\fP に \fBERANGE\fP が設定される。 オーバーフロー浮動小数点例外 (\fBFE_OVERFLOW\fP)  が上がる。
100 .TP 
101 範囲エラー (range error): 結果のアンダーフロー
102 .\" .I errno
103 .\" is set to
104 .\" .BR ERANGE .
105 アンダーフロー浮動小数点例外 (\fBFE_UNDERFLOW\fP)  が上がる。
106 .IP
107 .\" FIXME . Is it intentional that these functions do not set errno?
108 .\" They do set errno for the overflow case.
109 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6795
110 これらの関数は、この場合に \fIerrno\fP を設定しない。
111 .SH 準拠
112 C99, POSIX.1\-2001.  \fIdouble\fP 版の関数は SVr4, 4.3BSD にも準拠している。
113 .SH 関連項目
114 \fBcabs\fP(3), \fBsqrt\fP(3)
115 .SH この文書について
116 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.40 の一部
117 である。プロジェクトの説明とバグ報告に関する情報は
118 http://www.kernel.org/doc/man\-pages/ に書かれている。