cmathcalls.h 4.0 KB

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