]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/fortran/doc/gfortran/intrinsic-procedures/hypot.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / fortran / doc / gfortran / intrinsic-procedures / hypot.rst
1 ..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6 .. index:: HYPOT, Euclidean distance
7
8 .. _hypot:
9
10 HYPOT --- Euclidean distance function
11 *************************************
12
13 .. function:: HYPOT(X,Y)
14
15 ``HYPOT(X,Y)`` is the Euclidean distance function. It is equal to
16 \sqrt{X^2 + Y^2}, without undue underflow or overflow.
17
18 :param X:
19 The type shall be ``REAL``.
20
21 :param Y:
22 The type and kind type parameter shall be the same as
23 :samp:`{X}`.
24
25 :return:
26 The return value has the same type and kind type parameter as :samp:`{X}`.
27
28 Standard:
29 Fortran 2008 and later
30
31 Class:
32 Elemental function
33
34 Syntax:
35 .. code-block:: fortran
36
37 RESULT = HYPOT(X, Y)
38
39 Example:
40 .. code-block:: fortran
41
42 program test_hypot
43 real(4) :: x = 1.e0_4, y = 0.5e0_4
44 x = hypot(x,y)
45 end program test_hypot