]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/fortran/doc/gfortran/intrinsic-procedures/cosd.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / fortran / doc / gfortran / intrinsic-procedures / cosd.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 .. _cosd:
7
8 .. index:: COSD
9
10 .. index:: DCOSD
11
12 .. index:: CCOSD
13
14 .. index:: ZCOSD
15
16 .. index:: CDCOSD
17
18 .. index:: trigonometric function, cosine, degrees
19
20 .. index:: cosine, degrees
21
22 COSD --- Cosine function, degrees
23 *********************************
24
25 .. function:: COSD(X)
26
27 ``COSD(X)`` computes the cosine of :samp:`{X}` in degrees.
28
29 :param X:
30 The type shall be ``REAL`` or
31 ``COMPLEX``.
32
33 :return:
34 The return value is of the same type and kind as :samp:`{X}`. The real part
35 of the result is in degrees. If :samp:`{X}` is of the type ``REAL``,
36 the return value lies in the range -1 \leq \cosd (x) \leq 1.
37
38 Standard:
39 GNU extension, enabled with :option:`-fdec-math`.
40
41 Class:
42 Elemental function
43
44 Syntax:
45 .. code-block:: fortran
46
47 RESULT = COSD(X)
48
49 Example:
50 .. code-block:: fortran
51
52 program test_cosd
53 real :: x = 0.0
54 x = cosd(x)
55 end program test_cosd
56
57 Specific names:
58 .. list-table::
59 :header-rows: 1
60
61 * - Name
62 - Argument
63 - Return type
64 - Standard
65
66 * - ``COSD(X)``
67 - ``REAL(4) X``
68 - ``REAL(4)``
69 - GNU extension
70 * - ``DCOSD(X)``
71 - ``REAL(8) X``
72 - ``REAL(8)``
73 - GNU extension
74 * - ``CCOSD(X)``
75 - ``COMPLEX(4) X``
76 - ``COMPLEX(4)``
77 - GNU extension
78 * - ``ZCOSD(X)``
79 - ``COMPLEX(8) X``
80 - ``COMPLEX(8)``
81 - GNU extension
82 * - ``CDCOSD(X)``
83 - ``COMPLEX(8) X``
84 - ``COMPLEX(8)``
85 - GNU extension
86
87 See also:
88 Inverse function:
89 :ref:`ACOSD`
90 Radians function:
91 :ref:`COS`