master
  1/* Prototype declarations for complex math functions;
  2   helper file for <complex.h>.
  3   Copyright (C) 1997-2025 Free Software Foundation, Inc.
  4   This file is part of the GNU C Library.
  5
  6   The GNU C Library is free software; you can redistribute it and/or
  7   modify it under the terms of the GNU Lesser General Public
  8   License as published by the Free Software Foundation; either
  9   version 2.1 of the License, or (at your option) any later version.
 10
 11   The GNU C Library is distributed in the hope that it will be useful,
 12   but WITHOUT ANY WARRANTY; without even the implied warranty of
 13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 14   Lesser General Public License for more details.
 15
 16   You should have received a copy of the GNU Lesser General Public
 17   License along with the GNU C Library; if not, see
 18   <https://www.gnu.org/licenses/>.  */
 19
 20/* NOTE: Because of the special way this file is used by <complex.h>, this
 21   file must NOT be protected from multiple inclusion as header files
 22   usually are.
 23
 24   This file provides prototype declarations for the math functions.
 25   Most functions are declared using the macro:
 26
 27   __MATHCALL (NAME, (ARGS...));
 28
 29   This means there is a function `NAME' returning `double' and a function
 30   `NAMEf' returning `float'.  Each place `_Mdouble_' appears in the
 31   prototype, that is actually `double' in the prototype for `NAME' and
 32   `float' in the prototype for `NAMEf'.  Reentrant variant functions are
 33   called `NAME_r' and `NAMEf_r'.
 34
 35   Functions returning other types like `int' are declared using the macro:
 36
 37   __MATHDECL (TYPE, NAME, (ARGS...));
 38
 39   This is just like __MATHCALL but for a function returning `TYPE'
 40   instead of `_Mdouble_'.  In all of these cases, there is still
 41   both a `NAME' and a `NAMEf' that takes `float' arguments.  */
 42
 43#ifndef _COMPLEX_H
 44#error "Never use <bits/cmathcalls.h> directly; include <complex.h> instead."
 45#endif
 46
 47#ifndef _Mdouble_complex_
 48# define _Mdouble_complex_ _Mdouble_ _Complex
 49#endif
 50
 51
 52/* Trigonometric functions.  */
 53
 54/* Arc cosine of Z.  */
 55__MATHCALL (cacos, (_Mdouble_complex_ __z));
 56/* Arc sine of Z.  */
 57__MATHCALL (casin, (_Mdouble_complex_ __z));
 58/* Arc tangent of Z.  */
 59__MATHCALL (catan, (_Mdouble_complex_ __z));
 60
 61/* Cosine of Z.  */
 62__MATHCALL (ccos, (_Mdouble_complex_ __z));
 63/* Sine of Z.  */
 64__MATHCALL (csin, (_Mdouble_complex_ __z));
 65/* Tangent of Z.  */
 66__MATHCALL (ctan, (_Mdouble_complex_ __z));
 67
 68
 69/* Hyperbolic functions.  */
 70
 71/* Hyperbolic arc cosine of Z.  */
 72__MATHCALL (cacosh, (_Mdouble_complex_ __z));
 73/* Hyperbolic arc sine of Z.  */
 74__MATHCALL (casinh, (_Mdouble_complex_ __z));
 75/* Hyperbolic arc tangent of Z.  */
 76__MATHCALL (catanh, (_Mdouble_complex_ __z));
 77
 78/* Hyperbolic cosine of Z.  */
 79__MATHCALL (ccosh, (_Mdouble_complex_ __z));
 80/* Hyperbolic sine of Z.  */
 81__MATHCALL (csinh, (_Mdouble_complex_ __z));
 82/* Hyperbolic tangent of Z.  */
 83__MATHCALL (ctanh, (_Mdouble_complex_ __z));
 84
 85
 86/* Exponential and logarithmic functions.  */
 87
 88/* Exponential function of Z.  */
 89__MATHCALL (cexp, (_Mdouble_complex_ __z));
 90
 91/* Natural logarithm of Z.  */
 92__MATHCALL (clog, (_Mdouble_complex_ __z));
 93
 94#ifdef __USE_GNU
 95/* The base 10 logarithm is not defined by the standard but to implement
 96   the standard C++ library it is handy.  */
 97__MATHCALL (clog10, (_Mdouble_complex_ __z));
 98#endif
 99
100/* Power functions.  */
101
102/* Return X to the Y power.  */
103__MATHCALL (cpow, (_Mdouble_complex_ __x, _Mdouble_complex_ __y));
104
105/* Return the square root of Z.  */
106__MATHCALL (csqrt, (_Mdouble_complex_ __z));
107
108
109/* Absolute value, conjugates, and projection.  */
110
111/* Absolute value of Z.  */
112__MATHDECL (_Mdouble_,cabs, (_Mdouble_complex_ __z));
113
114/* Argument value of Z.  */
115__MATHDECL (_Mdouble_,carg, (_Mdouble_complex_ __z));
116
117/* Complex conjugate of Z.  */
118__MATHCALL (conj, (_Mdouble_complex_ __z));
119
120/* Projection of Z onto the Riemann sphere.  */
121__MATHCALL (cproj, (_Mdouble_complex_ __z));
122
123
124/* Decomposing complex values.  */
125
126/* Imaginary part of Z.  */
127__MATHDECL (_Mdouble_,cimag, (_Mdouble_complex_ __z));
128
129/* Real part of Z.  */
130__MATHDECL (_Mdouble_,creal, (_Mdouble_complex_ __z));