]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/fortran/doc/gfortran/intrinsic-procedures/atan.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / fortran / doc / gfortran / intrinsic-procedures / atan.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 .. _atan:
7
8 .. index:: ATAN
9
10 .. index:: DATAN
11
12 .. index:: trigonometric function, tangent, inverse
13
14 .. index:: tangent, inverse
15
16 ATAN --- Arctangent function
17 *****************************
18
19 .. function:: ATAN(X)
20
21 ``ATAN(X)`` computes the arctangent of :samp:`{X}`.
22
23 :param X:
24 The type shall be ``REAL`` or ``COMPLEX`` ;
25 if :samp:`{Y}` is present, :samp:`{X}` shall be REAL.
26
27 :param Y:
28 The type and kind type parameter shall be the same as :samp:`{X}`.
29
30 :return:
31 The return value is of the same type and kind as :samp:`{X}`.
32 If :samp:`{Y}` is present, the result is identical to ``ATAN2(Y,X)``.
33 Otherwise, it the arcus tangent of :samp:`{X}`, where the real part of
34 the result is in radians and lies in the range
35 -\pi/2 \leq \Re \atan(x) \leq \pi/2.
36
37 Standard:
38 Fortran 77 and later, for a complex argument and for two arguments
39 Fortran 2008 or later
40
41 Class:
42 Elemental function
43
44 Syntax:
45 .. code-block:: fortran
46
47 RESULT = ATAN(X)
48 RESULT = ATAN(Y, X)
49
50 Example:
51 .. code-block:: fortran
52
53 program test_atan
54 real(8) :: x = 2.866_8
55 x = atan(x)
56 end program test_atan
57
58 Specific names:
59 .. list-table::
60 :header-rows: 1
61
62 * - Name
63 - Argument
64 - Return type
65 - Standard
66
67 * - ``ATAN(X)``
68 - ``REAL(4) X``
69 - ``REAL(4)``
70 - Fortran 77 and later
71 * - ``DATAN(X)``
72 - ``REAL(8) X``
73 - ``REAL(8)``
74 - Fortran 77 and later
75
76 See also:
77 Inverse function:
78 :ref:`TAN`
79 Degrees function:
80 :ref:`ATAND`