2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\" References consulted:
7 .\" Linux libc source code
8 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
10 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
11 .\" Modified 2002-07-27 by Walter Harms
12 .\" (walter.harms@informatik.uni-oldenburg.de)
14 .TH hypot 3 (date) "Linux man-pages (unreleased)"
16 hypot, hypotf, hypotl \- Euclidean distance function
19 .RI ( libm ", " \-lm )
24 .BI "double hypot(double " x ", double " y );
25 .BI "float hypotf(float " x ", float " y );
26 .BI "long double hypotl(long double " x ", long double " y );
30 Feature Test Macro Requirements for glibc (see
31 .BR feature_test_macros (7)):
36 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
38 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
39 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
45 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
46 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
47 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
50 These functions return
51 .RI sqrt( x * x + y * y ).
52 This is the length of the hypotenuse of a right-angled triangle
57 or the distance of the point
61 The calculation is performed without undue overflow or underflow
62 during the intermediate steps of the calculation.
63 .\" e.g., hypot(DBL_MIN, DBL_MIN) does the right thing, as does, say
64 .\" hypot(DBL_MAX/2.0, DBL_MAX/2.0).
66 On success, these functions return the length of the hypotenuse of
67 a right-angled triangle
78 positive infinity is returned.
85 and the other argument is not an infinity,
88 If the result overflows,
90 and the functions return
97 If both arguments are subnormal, and the result is subnormal,
98 .\" Actually, could the result not be subnormal if both arguments
99 .\" are subnormal? I think not -- mtk, Jul 2008
100 a range error occurs,
101 and the correct result is returned.
105 for information on how to determine whether an error has occurred
106 when calling these functions.
108 The following errors can occur:
110 Range error: result overflow
114 An overflow floating-point exception
118 Range error: result underflow
119 An underflow floating-point exception
123 These functions do not set
126 .\" This is intentional; see
127 .\" https://www.sourceware.org/bugzilla/show_bug.cgi?id=6795
129 For an explanation of the terms used in this section, see
135 Interface Attribute Value
142 T} Thread safety MT-Safe
150 The variant returning