1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
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.
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.
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
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" References consulted:
26 .\" Linux libc source code
27 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
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)
33 .TH HYPOT 3 2017-09-15 "" "Linux Programmer's Manual"
35 hypot, hypotf, hypotl \- Euclidean distance function
40 .BI "double hypot(double " x ", double " y );
41 .BI "float hypotf(float " x ", float " y );
42 .BI "long double hypotl(long double " x ", long double " y );
48 Feature Test Macro Requirements for glibc (see
49 .BR feature_test_macros (7)):
55 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
57 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
58 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
64 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
65 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
66 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
70 These functions return
71 .RI sqrt( x * x + y * y ).
72 This is the length of the hypotenuse of a right-angled triangle
77 or the distance of the point
81 The calculation is performed without undue overflow or underflow
82 during the intermediate steps of the calculation.
83 .\" e.g., hypot(DBL_MIN, DBL_MIN) does the right thing, as does, say
84 .\" hypot(DBL_MAX/2.0, DBL_MAX/2.0).
86 On success, these functions return the length of a right-angled triangle
97 positive infinity is returned.
104 and the other argument is not an infinity,
107 If the result overflows,
108 a range error occurs,
109 and the functions return
116 If both arguments are subnormal, and the result is subnormal,
117 .\" Actually, could the result not be subnormal if both arguments
118 .\" are subnormal? I think not -- mtk, Jul 2008
119 a range error occurs,
120 and the correct result is returned.
124 for information on how to determine whether an error has occurred
125 when calling these functions.
127 The following errors can occur:
129 Range error: result overflow
133 An overflow floating-point exception
137 Range error: result underflow
141 An underflow floating-point exception
145 These functions do not set
148 .\" FIXME . Is it intentional that these functions do not set errno?
149 .\" They do set errno for the overflow case.
150 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6795
152 For an explanation of the terms used in this section, see
158 Interface Attribute Value
163 T} Thread safety MT-Safe
167 C99, POSIX.1-2001, POSIX.1-2008.
169 The variant returning