OSDN Git Service

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