.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" .\" Japanese Version Copyright (c) 1996 Kenji Kajiwara .\" all rights reserved. .\" Translated Mon Jul 15 18:20:00 JST 1996 .\" by Kenji Kajiwara .\" Proof Reading: Takashi Yoshino .\" Updated & Modified Sun Jun 6 05:30:45 JST 2004 .\" by Yuichi SATO .\" Updated & Modified Sat Jan 15 02:32:55 JST 2005 by Yuichi SATO .\" Updated 2008-09-18, Akihiro MOTOKI .\" .TH HYPOT 3 2010-09-20 "" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O hypot, hypotf, hypotl \- Euclidean distance function hypot, hypotf, hypotl \- ユークリッド距離関数 .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "double hypot(double " x ", double " y ); .br .BI "float hypotf(float " x ", float " y ); .br .BI "long double hypotl(long double " x ", long double " y ); .fi .sp .\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .ad l .BR hypot (): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br or .I cc\ -std=c99 .RE .br .BR hypotf (), .BR hypotl (): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br or .I cc\ -std=c99 .RE .ad b .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR hypot () .\"O function returns .\"O .RI sqrt( x * x + y * y ). .BR hypot () 関数は .RI sqrt( x * x + y * y ) の値を返す。 .\"O This is the length of the hypotenuse of a right-angled triangle .\"O with sides of length .\"O .I x .\"O and .\"O .IR y , .\"O or the distance of the point .\"O .RI ( x , y ) .\"O from the origin. これは 直角を挟む 2 辺の長さが .I x と .I y である直角三角形の斜辺の長さ、 すなわち、原点と点 .RI ( x , y ) との距離である。 .\"O The calculation is performed without undue overflow or underflow .\"O during the intermediate steps of the calculation. 計算の中間ステップでは、必要以上のオーバーフローやアンダーフローが 起きないようにして計算が実行される。 .\" e.g., hypot(DBL_MIN, DBL_MIN) does the right thing, as does, say .\" hypot(DBL_MAX/2.0, DBL_MAX/2.0). .\"O .SH RETURN VALUE .SH 返り値 .\"O On success, these functions return the length of a right-angled triangle .\"O with sides of length .\"O .I x .\"O and .\"O .IR y . 成功すると、これらの関数は、 直角を挟む 2 辺の長さが .I x と .I y である直角三角形の斜辺の長さを返す。 .\"O If .\"O .I x .\"O or .\"O .I y .\"O is an infinity, .\"O positive infinity is returned. .I x か .I y が無限大の場合、正の無限大が返される。 .\"O If .\"O .I x .\"O or .\"O .I y .\"O is a NaN, .\"O and the other argument is not an infinity, .\"O a NaN is returned. .I x か .I y の一方が NaN で、もう一方が無限大でない場合、 NaN が返される。 .\"O If the result overflows, .\"O a range error occurs, .\"O and the functions return .\"O .BR HUGE_VAL , .\"O .BR HUGE_VALF , .\"O or .\"O .BR HUGE_VALL , .\"O respectively. 結果がオーバーフローする場合、範囲エラー (range error) が発生し、 各関数はそれぞれ .BR HUGE_VAL , .BR HUGE_VALF , .B HUGE_VALL を返す。 .\"O If both arguments are subnormal, and the result is subnormal, 両方の引き数が非正規化数 (subnormal) で、結果も非正規化数 (subnormal) の場合、 .\" Actually, could the result not be subnormal if both arguments .\" are subnormal? I think not -- mtk, Jul 2008 .\"O a range error occurs, .\"O and the correct result is returned. 範囲エラーが発生し、正しい結果が返される。 .\"O .SH ERRORS .SH エラー .\"O See .\"O .BR math_error (7) .\"O for information on how to determine whether an error has occurred .\"O when calling these functions. これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は .BR math_error (7) を参照のこと。 .PP .\"O The following errors can occur: 以下のエラーが発生する可能性がある。 .TP .\"O Range error: result overflow 範囲エラー: 結果のオーバーフロー .\"O .I errno .\"O is set to .\"O .BR ERANGE . .\"O An overflow floating-point exception .\"O .RB ( FE_OVERFLOW ) .\"O is raised. .I errno に .B ERANGE が設定される。 オーバーフロー浮動小数点例外 .RB ( FE_OVERFLOW ) が上がる。 .TP .\"O Range error: result underflow 範囲エラー: 結果のアンダーフロー .\" .I errno .\" is set to .\" .BR ERANGE . .\"O An underflow floating-point exception .\"O .RB ( FE_UNDERFLOW ) .\"O is raised. アンダーフロー浮動小数点例外 .RB ( FE_UNDERFLOW ) が上がる。 .IP .\"O These functions do not set .\"O .IR errno .\"O for this case. この場合、これらの関数は .I errno を設定しない。 .\" FIXME . Is it intentional that these functions do not set errno? .\" They do set errno for the overflow case. .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6795 .\"O .SH "CONFORMING TO" .SH 準拠 C99, POSIX.1-2001. .\"O The variant returning .\"O .I double .\"O also conforms to .\"O SVr4, 4.3BSD. .I double 版の関数は SVr4, 4.3BSD にも準拠している。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR cabs (3), .BR sqrt (3)